diff options
author | Tobias Markmann <tm@ayena.de> | 2012-03-27 23:01:17 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-04-12 14:09:34 (GMT) |
commit | 2dcdee8e9f657c7f5c5d5c507373fd328beaa568 (patch) | |
tree | f6c0516afefdcf1561e32b45a415a387bc71f9d3 /Swift/QtUI/EventViewer/QtEventWindow.cpp | |
parent | 0bf6afc5c01b9eb3024a8cfd04bfd743890db4f6 (diff) | |
download | swift-contrib-2dcdee8e9f657c7f5c5d5c507373fd328beaa568.zip swift-contrib-2dcdee8e9f657c7f5c5d5c507373fd328beaa568.tar.bz2 |
Refactoring incoming MUC invites UI.
Making MUC invites non-modal by moving them into the chat view.
Adding event classes for invites so they turn up in 'Notices'-tab and generate notifications.
License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
Diffstat (limited to 'Swift/QtUI/EventViewer/QtEventWindow.cpp')
-rw-r--r-- | Swift/QtUI/EventViewer/QtEventWindow.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Swift/QtUI/EventViewer/QtEventWindow.cpp b/Swift/QtUI/EventViewer/QtEventWindow.cpp index fdc0194..35473b6 100644 --- a/Swift/QtUI/EventViewer/QtEventWindow.cpp +++ b/Swift/QtUI/EventViewer/QtEventWindow.cpp @@ -16,6 +16,7 @@ #include "Swift/Controllers/XMPPEvents/ErrorEvent.h" #include "Swift/QtUI/QtSubscriptionRequestWindow.h" #include "Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h" +#include "Swift/Controllers/XMPPEvents/MUCInviteEvent.h" #include "Swift/Controllers/UIEvents/RequestChatUIEvent.h" #include "Swift/Controllers/UIEvents/JoinMUCUIEvent.h" @@ -75,8 +76,9 @@ void QtEventWindow::handleItemActivated(const QModelIndex& item) { QtEvent* event = model_->getItem(item.row()); boost::shared_ptr<MessageEvent> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(event->getEvent()); boost::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(event->getEvent()); + boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event->getEvent()); boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(event->getEvent()); - + if (messageEvent) { if (messageEvent->getStanza()->getType() == Message::Groupchat) { eventStream_->send(boost::shared_ptr<UIEvent>(new JoinMUCUIEvent(messageEvent->getStanza()->getFrom().toBare(), messageEvent->getStanza()->getTo().getResource()))); @@ -86,6 +88,9 @@ void QtEventWindow::handleItemActivated(const QModelIndex& item) { } else if (subscriptionEvent) { QtSubscriptionRequestWindow* window = QtSubscriptionRequestWindow::getWindow(subscriptionEvent, this); window->show(); + } else if (mucInviteEvent) { + eventStream_->send(boost::shared_ptr<UIEvent>(new RequestChatUIEvent(mucInviteEvent->getInviter()))); + mucInviteEvent->conclude(); } else { if (errorEvent) { errorEvent->conclude(); |