diff options
author | Kevin Smith <git@kismith.co.uk> | 2012-02-29 09:27:52 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-02-29 09:27:56 (GMT) |
commit | 84f6c22878d11ff4b0deed1a1c15b4db47177917 (patch) | |
tree | 071dda6a00e6fbe98a0805f986c6f779621b185f /Swift | |
parent | b28821b2e88ec138f920b818c50419b4c427cc6b (diff) | |
download | swift-contrib-84f6c22878d11ff4b0deed1a1c15b4db47177917.zip swift-contrib-84f6c22878d11ff4b0deed1a1c15b4db47177917.tar.bz2 |
Don't crash when trying to join MUCs offline
Resolves: #940
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index a2b286f..557aef4 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -547,6 +547,10 @@ void ChatsManager::rebindControllerJID(const JID& from, const JID& to) { } void ChatsManager::handleJoinMUCRequest(const JID &mucJID, const boost::optional<std::string>& password, const boost::optional<std::string>& nickMaybe, bool addAutoJoin, bool createAsReservedIfNew) { + if (!stanzaChannel_->isAvailable()) { + /* This is potentially not the optimal solution, but it will avoid consistency issues.*/ + return; + } if (addAutoJoin) { MUCBookmark bookmark(mucJID, mucJID.getNode()); bookmark.setAutojoin(true); |