summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/ChatList/QtChatListWindow.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/Swift/QtUI/ChatList/QtChatListWindow.cpp b/Swift/QtUI/ChatList/QtChatListWindow.cpp
index d71563d..7ef6ae5 100644
--- a/Swift/QtUI/ChatList/QtChatListWindow.cpp
+++ b/Swift/QtUI/ChatList/QtChatListWindow.cpp
@@ -71,24 +71,15 @@ void QtChatListWindow::setupContextMenus() {
void QtChatListWindow::handleItemActivated(const QModelIndex& index) {
ChatListItem* item = model_->getItemForIndex(index);
- ChatListMUCItem* mucItem = dynamic_cast<ChatListMUCItem*>(item);
- 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;
- if (recentItem->getChat().isMUC) {
- if (!bookmarksEnabled_) {
- return;
- }
- return;
+ if (ChatListMUCItem* mucItem = dynamic_cast<ChatListMUCItem*>(item)) {
+ if (bookmarksEnabled_) {
+ onMUCBookmarkActivated(mucItem->getBookmark());
}
- else {
- event = boost::shared_ptr<UIEvent>(new RequestChatUIEvent(recentItem->getChat().jid));
+ }
+ else if (ChatListRecentItem* recentItem = dynamic_cast<ChatListRecentItem*>(item)) {
+ if (!recentItem->getChat().isMUC || bookmarksEnabled_) {
+ onRecentActivated(recentItem->getChat());
}
- eventStream_->send(event);
}
}