summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/EventController.cpp4
-rw-r--r--Swift/Controllers/MainController.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/Swift/Controllers/EventController.cpp b/Swift/Controllers/EventController.cpp
index 70d56c7..bf24ff0 100644
--- a/Swift/Controllers/EventController.cpp
+++ b/Swift/Controllers/EventController.cpp
@@ -10,6 +10,7 @@
#include <algorithm>
#include "Swiften/Events/MessageEvent.h"
+#include "Swiften/Events/ErrorEvent.h"
#include "Swiften/Events/SubscriptionRequestEvent.h"
namespace Swift {
@@ -20,7 +21,8 @@ EventController::EventController() {
void EventController::handleIncomingEvent(boost::shared_ptr<StanzaEvent> sourceEvent) {
boost::shared_ptr<MessageEvent> messageEvent = boost::dynamic_pointer_cast<MessageEvent>(sourceEvent);
boost::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(sourceEvent);
- if ((messageEvent && messageEvent->isReadable()) || subscriptionEvent) {
+ boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(sourceEvent);
+ if ((messageEvent && messageEvent->isReadable()) || subscriptionEvent || errorEvent) {
events_.push_back(sourceEvent);
sourceEvent->onConclusion.connect(boost::bind(&EventController::handleEventConcluded, this, sourceEvent));
onEventQueueLengthChange(events_.size());
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index 33928f8..e8c6c94 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -353,9 +353,11 @@ void MainController::handleError(const ClientError& error) {
signOut();
loginWindow_->setMessage(message);
} else {
+ std::cout << "Yay, error" << std::endl;
if (!lastDisconnectError_) {
- message = "Disconnected from " + jid_.getDomain() + ": ";
+ message = "Disconnected from " + jid_.getDomain() + ": " + message;
lastDisconnectError_ = boost::shared_ptr<ErrorEvent>(new ErrorEvent(JID(jid_.getDomain()), message));
+ std::cout << message << std::endl;
eventController_->handleIncomingEvent(lastDisconnectError_);
}
}