summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-04-28 08:28:26 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-04-28 08:39:20 (GMT)
commit42b9cb3130a23524487bb3fa2e818da8b82880c7 (patch)
tree0a647407ce7cf10d12c4603d738b2f134fb895d0 /Swift/QtUI/ChatList/QtChatListWindow.cpp
parentf48dbee2fb5acf7c0abc9d7897d736233b1f0d2f (diff)
downloadswift-42b9cb3130a23524487bb3fa2e818da8b82880c7.zip
swift-42b9cb3130a23524487bb3fa2e818da8b82880c7.tar.bz2
Recent chats are now persisted.
Release-Notes: A list of recent chats is now kept in the 'Chats' tab of the main window. Resolves: #181
Diffstat (limited to 'Swift/QtUI/ChatList/QtChatListWindow.cpp')
-rw-r--r--Swift/QtUI/ChatList/QtChatListWindow.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/Swift/QtUI/ChatList/QtChatListWindow.cpp b/Swift/QtUI/ChatList/QtChatListWindow.cpp
index a3dbd78..d71563d 100644
--- a/Swift/QtUI/ChatList/QtChatListWindow.cpp
+++ b/Swift/QtUI/ChatList/QtChatListWindow.cpp
@@ -70,18 +70,24 @@ void QtChatListWindow::setupContextMenus() {
}
void QtChatListWindow::handleItemActivated(const QModelIndex& index) {
- if (!bookmarksEnabled_) {
- return;
- }
ChatListItem* item = model_->getItemForIndex(index);
ChatListMUCItem* mucItem = dynamic_cast<ChatListMUCItem*>(item);
- if (mucItem) {
+ if (bookmarksEnabled_ && mucItem) {
boost::shared_ptr<UIEvent> event(new JoinMUCUIEvent(mucItem->getBookmark().getRoom(), mucItem->getBookmark().getNick()));
eventStream_->send(event);
}
ChatListRecentItem* recentItem = dynamic_cast<ChatListRecentItem*>(item);
if (recentItem) {
- boost::shared_ptr<UIEvent> event(new RequestChatUIEvent(recentItem->getChat().jid));
+ boost::shared_ptr<UIEvent> event;
+ if (recentItem->getChat().isMUC) {
+ if (!bookmarksEnabled_) {
+ return;
+ }
+ return;
+ }
+ else {
+ event = boost::shared_ptr<UIEvent>(new RequestChatUIEvent(recentItem->getChat().jid));
+ }
eventStream_->send(event);
}
}