diff options
Diffstat (limited to 'Swiften/MUC')
-rw-r--r-- | Swiften/MUC/MUC.cpp | 12 | ||||
-rw-r--r-- | Swiften/MUC/MUC.h | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/Swiften/MUC/MUC.cpp b/Swiften/MUC/MUC.cpp index 9f7c500..b0365d4 100644 --- a/Swiften/MUC/MUC.cpp +++ b/Swiften/MUC/MUC.cpp @@ -34,6 +34,7 @@ MUC::MUC(StanzaChannel* stanzaChannel, IQRouter* iqRouter, DirectedPresenceSende * Join the MUC with default context. */ void MUC::joinAs(const String &nick) { + joinSince_ = boost::posix_time::not_a_date_time; internalJoin(nick); } @@ -43,17 +44,20 @@ void MUC::internalJoin(const String &nick) { 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())); + boost::shared_ptr<MUCPayload> mucPayload(new MUCPayload()); + if (joinSince_ != boost::posix_time::not_a_date_time) { + mucPayload->setSince(joinSince_); + } + joinPresence->addPayload(mucPayload); presenceSender->sendPresence(joinPresence); } /** * Join the MUC with context since date. */ -void MUC::joinWithContextSince(const String &nick) { - //FIXME: add date +void MUC::joinWithContextSince(const String &nick, const boost::posix_time::ptime& since) { + joinSince_ = since; internalJoin(nick); } diff --git a/Swiften/MUC/MUC.h b/Swiften/MUC/MUC.h index 29dbbe1..672cdf2 100644 --- a/Swiften/MUC/MUC.h +++ b/Swiften/MUC/MUC.h @@ -42,7 +42,7 @@ namespace Swift { } void joinAs(const String &nick); - void joinWithContextSince(const String &nick); + void joinWithContextSince(const String &nick, const boost::posix_time::ptime& since); /*void queryRoomInfo(); */ /*void queryRoomItems(); */ String getCurrentNick(); @@ -85,5 +85,6 @@ namespace Swift { std::map<String, MUCOccupant> occupants; bool joinComplete_; boost::bsignals::scoped_connection scopedConnection_; + boost::posix_time::ptime joinSince_; }; } |