diff options
Diffstat (limited to 'Swiften/MUC')
-rw-r--r-- | Swiften/MUC/MUC.cpp | 18 | ||||
-rw-r--r-- | Swiften/MUC/MUC.h | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/Swiften/MUC/MUC.cpp b/Swiften/MUC/MUC.cpp index 8f04308..cfd468c 100644 --- a/Swiften/MUC/MUC.cpp +++ b/Swiften/MUC/MUC.cpp @@ -28,19 +28,33 @@ MUC::MUC(StanzaChannel* stanzaChannel, IQRouter* iqRouter, PresenceSender* prese //FIXME: discover reserved nickname +/** + * Join the MUC with default context. + */ void MUC::joinAs(const String &nick) { + internalJoin(nick); +} + +void MUC::internalJoin(const String &nick) { //TODO: password //TODO: history request joinComplete_ = false; - ownMUCJID = JID(ownMUCJID.getNode(), ownMUCJID.getDomain(), nick); - boost::shared_ptr<Presence> joinPresence(presenceSender->getLastSentUndirectedPresence()); + //FIXME: use date joinPresence->setTo(ownMUCJID); joinPresence->addPayload(boost::shared_ptr<Payload>(new MUCPayload())); presenceSender->sendPresence(joinPresence); } +/** + * Join the MUC with context since date. + */ +void MUC::joinWithContextSince(const String &nick) { + //FIXME: add date + internalJoin(nick); +} + void MUC::part() { presenceSender->removeDirectedPresenceReceiver(ownMUCJID); } diff --git a/Swiften/MUC/MUC.h b/Swiften/MUC/MUC.h index af3daa8..ea20ac4 100644 --- a/Swiften/MUC/MUC.h +++ b/Swiften/MUC/MUC.h @@ -32,6 +32,7 @@ namespace Swift { MUC(StanzaChannel* stanzaChannel, IQRouter* iqRouter, PresenceSender* presenceSender, const JID &muc); void joinAs(const String &nick); + void joinWithContextSince(const String &nick); /*void queryRoomInfo(); */ /*void queryRoomItems(); */ String getCurrentNick(); @@ -63,6 +64,7 @@ namespace Swift { private: void handleIncomingPresence(boost::shared_ptr<Presence> presence); + void internalJoin(const String& nick); private: JID ownMUCJID; |