summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-10-20 07:58:12 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-10-20 08:04:21 (GMT)
commitd46ebaac1cf7161fd0a551c34cf80f441f6d19ab (patch)
treea47705e770329b386b48b6fb5883965740cf438d /Swiften/MUC/MUC.cpp
parenta49ca97a7b2ad61385d0f6f22ec598a63d889ae7 (diff)
downloadswift-d46ebaac1cf7161fd0a551c34cf80f441f6d19ab.zip
swift-d46ebaac1cf7161fd0a551c34cf80f441f6d19ab.tar.bz2
Tell MUCController to handle disconnect/reconnect rejoins.
This causes the MUCController to deal with reconnects by requesting a rejoin. It also prepares for doing time-based context requests. Although I've traced the code down, and confirmed that presenceSender->sendPresence(joinPresence); is being called, the stanza is never sent. This needs further investigation, as currently it prevents the rejoins working. Resolves: #625
Diffstat (limited to 'Swiften/MUC/MUC.cpp')
-rw-r--r--Swiften/MUC/MUC.cpp18
1 files changed, 16 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);
}