summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/EventViewer/QtEvent.cpp')
-rw-r--r--Swift/QtUI/EventViewer/QtEvent.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/Swift/QtUI/EventViewer/QtEvent.cpp b/Swift/QtUI/EventViewer/QtEvent.cpp
index a84a440..4d90bd9 100644
--- a/Swift/QtUI/EventViewer/QtEvent.cpp
+++ b/Swift/QtUI/EventViewer/QtEvent.cpp
@@ -1,20 +1,21 @@
1/* 1/*
2 * Copyright (c) 2010 Isode Limited. 2 * Copyright (c) 2010-2015 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
6 6
7#include "Swift/QtUI/EventViewer/QtEvent.h" 7#include <Swift/QtUI/EventViewer/QtEvent.h>
8 8
9#include <QDateTime>
10#include <QColor> 9#include <QColor>
10#include <QDateTime>
11 11
12#include "Swift/Controllers/XMPPEvents/MessageEvent.h" 12#include <Swift/Controllers/XMPPEvents/ErrorEvent.h>
13#include "Swift/Controllers/XMPPEvents/ErrorEvent.h" 13#include <Swift/Controllers/XMPPEvents/IncomingFileTransferEvent.h>
14#include "Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h" 14#include <Swift/Controllers/XMPPEvents/MUCInviteEvent.h>
15#include "Swift/Controllers/XMPPEvents/MUCInviteEvent.h" 15#include <Swift/Controllers/XMPPEvents/MessageEvent.h>
16#include <Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h>
16 17
17#include "Swift/QtUI/QtSwiftUtil.h" 18#include "Swift/QtUI/QtSwiftUtil.h"
18 19
19namespace Swift { 20namespace Swift {
20 21
@@ -51,10 +52,14 @@ QString QtEvent::sender() {
51 } 52 }
52 boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event_); 53 boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event_);
53 if (mucInviteEvent) { 54 if (mucInviteEvent) {
54 return P2QSTRING(mucInviteEvent->getInviter().toString()); 55 return P2QSTRING(mucInviteEvent->getInviter().toString());
55 } 56 }
57 boost::shared_ptr<IncomingFileTransferEvent> incomingFTEvent = boost::dynamic_pointer_cast<IncomingFileTransferEvent>(event_);
58 if (incomingFTEvent) {
59 return P2QSTRING(incomingFTEvent->getSender().toString());
60 }
56 return ""; 61 return "";
57} 62}
58 63
59QString QtEvent::text() { 64QString QtEvent::text() {
60 boost::shared_ptr<MessageEvent> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(event_); 65 boost::shared_ptr<MessageEvent> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(event_);
@@ -80,9 +85,14 @@ QString QtEvent::text() {
80 boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event_); 85 boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(event_);
81 if (mucInviteEvent) { 86 if (mucInviteEvent) {
82 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())); 87 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()));
83 return message; 88 return message;
84 } 89 }
90 boost::shared_ptr<IncomingFileTransferEvent> incomingFTEvent = boost::dynamic_pointer_cast<IncomingFileTransferEvent>(event_);
91 if (incomingFTEvent) {
92 QString message = QString(QObject::tr("%1 would like to send a file to you.")).arg(P2QSTRING(incomingFTEvent->getSender().toBare().toString()));
93 return message;
94 }
85 return ""; 95 return "";
86} 96}
87 97
88} 98}