diff options
author | Kevin Smith <git@kismith.co.uk> | 2012-04-26 09:44:51 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-04-26 09:44:51 (GMT) |
commit | 4fc14f392e953ee2309312d9d8a07dc01303c838 (patch) | |
tree | 95717b7751b0ed573d430886e2ebb0758a809b36 /Swift/Controllers | |
parent | 47b1febe15092532fec41ebf077eccd9a2e45484 (diff) | |
download | swift-4fc14f392e953ee2309312d9d8a07dc01303c838.zip swift-4fc14f392e953ee2309312d9d8a07dc01303c838.tar.bz2 |
Mark recent chats offline when Swift is offline.
Resolves: #999
Diffstat (limited to 'Swift/Controllers')
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.cpp | 9 | ||||
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index aea5ef4..b0aef95 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -403,6 +403,14 @@ void ChatsManager::handleUIEvent(boost::shared_ptr<UIEvent> event) { } } +void ChatsManager::markAllRecentsOffline() { + foreach (ChatListWindow::Chat& chat, recentChats_) { + chat.setStatusType(StatusShow::None); + } + + chatListWindow_->setRecents(recentChats_); +} + /** * If a resource goes offline, release bound chatdialog to that resource. */ @@ -477,6 +485,7 @@ void ChatsManager::setOnline(bool enabled) { delete mucBookmarkManager_; mucBookmarkManager_ = NULL; chatListWindow_->setBookmarksEnabled(false); + markAllRecentsOffline(); } else { setupBookmarks(); } diff --git a/Swift/Controllers/Chat/ChatsManager.h b/Swift/Controllers/Chat/ChatsManager.h index e6666fa..a8c69c4 100644 --- a/Swift/Controllers/Chat/ChatsManager.h +++ b/Swift/Controllers/Chat/ChatsManager.h @@ -88,6 +88,7 @@ namespace Swift { void handleJIDUpdatedInRoster(const JID&); void handleRosterCleared(); void handleSettingChanged(const std::string& settingPath); + void markAllRecentsOffline(); void updatePresenceReceivingStateOnChatController(const JID&); |