summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-04-12 13:47:07 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-04-12 13:47:07 (GMT)
commita65372d1a0a85d04329cd91bcf6bdff2de492c80 (patch)
treee9ac9af516f402aa4ee62027894a28da5cab98ec /Swift/QtUI/EventViewer/QtEvent.cpp
parented38ddf609f1190ecb2aebb5e23ead115e6a6a8d (diff)
downloadswift-contrib-a65372d1a0a85d04329cd91bcf6bdff2de492c80.zip
swift-contrib-a65372d1a0a85d04329cd91bcf6bdff2de492c80.tar.bz2
Show ErrorEvent when roster push fails.
Resolves: #293
Diffstat (limited to 'Swift/QtUI/EventViewer/QtEvent.cpp')
-rw-r--r--Swift/QtUI/EventViewer/QtEvent.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Swift/QtUI/EventViewer/QtEvent.cpp b/Swift/QtUI/EventViewer/QtEvent.cpp
index 91df26f..76875ae 100644
--- a/Swift/QtUI/EventViewer/QtEvent.cpp
+++ b/Swift/QtUI/EventViewer/QtEvent.cpp
@@ -7,6 +7,7 @@
#include "Swift/QtUI/EventViewer/QtEvent.h"
#include "Swiften/Events/MessageEvent.h"
+#include "Swiften/Events/ErrorEvent.h"
#include "Swiften/Events/SubscriptionRequestEvent.h"
#include "Swift/QtUI/QtSwiftUtil.h"
@@ -41,6 +42,10 @@ QString QtEvent::text() {
String message = subscriptionRequestEvent->getJID().toBare().toString() + " would like to add you to their roster" + (reason.isEmpty() ? "." : ", saying '" + reason + "'.");
return P2QSTRING(message);
}
+ boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(event_);
+ if (errorEvent) {
+ return P2QSTRING(errorEvent->getText());
+ }
return "";
}