summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/XMPPEvents/EventController.cpp')
-rw-r--r--Swift/Controllers/XMPPEvents/EventController.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/Swift/Controllers/XMPPEvents/EventController.cpp b/Swift/Controllers/XMPPEvents/EventController.cpp
index 1561905..bbe7356 100644
--- a/Swift/Controllers/XMPPEvents/EventController.cpp
+++ b/Swift/Controllers/XMPPEvents/EventController.cpp
@@ -1,20 +1,23 @@
1/* 1/*
2 * Copyright (c) 2010-2012 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/Controllers/XMPPEvents/EventController.h> 7#include <Swift/Controllers/XMPPEvents/EventController.h>
8 8
9#include <algorithm>
10
9#include <boost/bind.hpp> 11#include <boost/bind.hpp>
10#include <boost/numeric/conversion/cast.hpp> 12#include <boost/numeric/conversion/cast.hpp>
11#include <algorithm>
12 13
13#include <Swiften/Base/foreach.h> 14#include <Swiften/Base/foreach.h>
14#include <Swift/Controllers/XMPPEvents/MessageEvent.h> 15
15#include <Swift/Controllers/XMPPEvents/ErrorEvent.h> 16#include <Swift/Controllers/XMPPEvents/ErrorEvent.h>
16#include <Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h> 17#include <Swift/Controllers/XMPPEvents/IncomingFileTransferEvent.h>
17#include <Swift/Controllers/XMPPEvents/MUCInviteEvent.h> 18#include <Swift/Controllers/XMPPEvents/MUCInviteEvent.h>
19#include <Swift/Controllers/XMPPEvents/MessageEvent.h>
20#include <Swift/Controllers/XMPPEvents/SubscriptionRequestEvent.h>
18 21
19namespace Swift { 22namespace Swift {
20 23
@@ -32,6 +35,7 @@ void EventController::handleIncomingEvent(boost::shared_ptr<StanzaEvent> sourceE
32 boost::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(sourceEvent); 35 boost::shared_ptr<SubscriptionRequestEvent> subscriptionEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(sourceEvent);
33 boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(sourceEvent); 36 boost::shared_ptr<ErrorEvent> errorEvent = boost::dynamic_pointer_cast<ErrorEvent>(sourceEvent);
34 boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(sourceEvent); 37 boost::shared_ptr<MUCInviteEvent> mucInviteEvent = boost::dynamic_pointer_cast<MUCInviteEvent>(sourceEvent);
38 boost::shared_ptr<IncomingFileTransferEvent> incomingFileTransferEvent = boost::dynamic_pointer_cast<IncomingFileTransferEvent>(sourceEvent);
35 39
36 /* If it's a duplicate subscription request, remove the previous request first */ 40 /* If it's a duplicate subscription request, remove the previous request first */
37 if (subscriptionEvent) { 41 if (subscriptionEvent) {
@@ -46,7 +50,7 @@ void EventController::handleIncomingEvent(boost::shared_ptr<StanzaEvent> sourceE
46 } 50 }
47 } 51 }
48 52
49 if ((messageEvent && messageEvent->isReadable()) || subscriptionEvent || errorEvent || mucInviteEvent) { 53 if ((messageEvent && messageEvent->isReadable()) || subscriptionEvent || errorEvent || mucInviteEvent || incomingFileTransferEvent) {
50 events_.push_back(sourceEvent); 54 events_.push_back(sourceEvent);
51 sourceEvent->onConclusion.connect(boost::bind(&EventController::handleEventConcluded, this, sourceEvent)); 55 sourceEvent->onConclusion.connect(boost::bind(&EventController::handleEventConcluded, this, sourceEvent));
52 onEventQueueLengthChange(boost::numeric_cast<int>(events_.size())); 56 onEventQueueLengthChange(boost::numeric_cast<int>(events_.size()));