summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/EventViewer/QtEvent.cpp')
-rw-r--r--Swift/QtUI/EventViewer/QtEvent.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Swift/QtUI/EventViewer/QtEvent.cpp b/Swift/QtUI/EventViewer/QtEvent.cpp
index e7ea473..3c6f16c 100644
--- a/Swift/QtUI/EventViewer/QtEvent.cpp
+++ b/Swift/QtUI/EventViewer/QtEvent.cpp
@@ -11,6 +11,7 @@
#include "Swift/Controllers/XMPPEvents/MessageEvent.h"
#include "Swift/Controllers/XMPPEvents/ErrorEvent.h"
#include "Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h"
+#include "Swift/Controllers/XMPPEvents/MUCInviteEvent.h"
#include "Swift/QtUI/QtSwiftUtil.h"
@@ -47,6 +48,10 @@ QString QtEvent::sender() {
if (errorEvent) {
return P2QSTRING(errorEvent->getJID().toBare().toString());
}
+ boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event_);
+ if (mucInviteEvent) {
+ return P2QSTRING(mucInviteEvent->getInviter().toString());
+ }
return "";
}
@@ -71,6 +76,11 @@ QString QtEvent::text() {
if (errorEvent) {
return P2QSTRING(errorEvent->getText());
}
+ boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event_);
+ if (mucInviteEvent) {
+ QString message = QString(QObject::tr("%1 has invited you to enter the %2 room.")).arg(P2QSTRING(mucInviteEvent->getInviter().toBare().toString())).arg(P2QSTRING(mucInviteEvent->getRoomJID().toString()));
+ return message;
+ }
return "";
}