summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-12-26 23:00:53 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-12-26 23:00:53 (GMT)
commit4d89c280976426c9e29ee9235b296afc4d38a7cd (patch)
tree5175891eebfc5cc05e64dc5e92ab5a1befcc85a2
parentc3bda61b09597a7944fbc382366bcdf998540e82 (diff)
downloadswift-contrib-4d89c280976426c9e29ee9235b296afc4d38a7cd.zip
swift-contrib-4d89c280976426c9e29ee9235b296afc4d38a7cd.tar.bz2
Fix segfault at launch due to argument reversal.
-rw-r--r--Swift/Controllers/ChatsManager.cpp2
-rw-r--r--Swift/Controllers/ChatsManager.h2
-rw-r--r--Swift/Controllers/UnitTest/ChatsManagerTest.cpp6
3 files changed, 5 insertions, 5 deletions
diff --git a/Swift/Controllers/ChatsManager.cpp b/Swift/Controllers/ChatsManager.cpp
index fe8efb3..2863a14 100644
--- a/Swift/Controllers/ChatsManager.cpp
+++ b/Swift/Controllers/ChatsManager.cpp
@@ -41,7 +41,7 @@ ChatsManager::~ChatsManager() {
/**
* If a resource goes offline, release bound chatdialog to that resource.
*/
-void ChatsManager::handlePresenceChange(boost::shared_ptr<Presence> /*oldPresence*/, boost::shared_ptr<Presence> newPresence) {
+void ChatsManager::handlePresenceChange(boost::shared_ptr<Presence> newPresence, boost::shared_ptr<Presence> /*lastPresence*/) {
if (newPresence->getType() != Presence::Unavailable) return;
JID fullJID(newPresence->getFrom());
std::map<JID, ChatController*>::iterator it = chatControllers_.find(fullJID);
diff --git a/Swift/Controllers/ChatsManager.h b/Swift/Controllers/ChatsManager.h
index 260bd1d..dd80d95 100644
--- a/Swift/Controllers/ChatsManager.h
+++ b/Swift/Controllers/ChatsManager.h
@@ -35,7 +35,7 @@ namespace Swift {
void handleJoinMUCRequest(const JID& muc, const String& nick);
private:
void rebindControllerJID(const JID& from, const JID& to);
- void handlePresenceChange(boost::shared_ptr<Presence> oldPresence, boost::shared_ptr<Presence> newPresence);
+ void handlePresenceChange(boost::shared_ptr<Presence> newPresence, boost::shared_ptr<Presence> lastPresence);
ChatController* getChatController(const JID &contact);
virtual bool isMUC(const JID& muc) const;
diff --git a/Swift/Controllers/UnitTest/ChatsManagerTest.cpp b/Swift/Controllers/UnitTest/ChatsManagerTest.cpp
index 9df244f..0dfc52b 100644
--- a/Swift/Controllers/UnitTest/ChatsManagerTest.cpp
+++ b/Swift/Controllers/UnitTest/ChatsManagerTest.cpp
@@ -176,7 +176,7 @@ public:
boost::shared_ptr<Presence> jid1Offline(new Presence());
jid1Offline->setFrom(JID(fullJIDString1));
jid1Offline->setType(Presence::Unavailable);
- presenceOracle_->onPresenceChange(jid1Online, jid1Offline);
+ presenceOracle_->onPresenceChange(jid1Offline, jid1Online);
boost::shared_ptr<Message> message2(new Message());
message2->setFrom(JID(fullJIDString2));
@@ -221,14 +221,14 @@ public:
boost::shared_ptr<Presence> jid1Offline(new Presence());
jid1Offline->setFrom(JID(messageJID1));
jid1Offline->setType(Presence::Unavailable);
- presenceOracle_->onPresenceChange(jid1Online, jid1Offline);
+ presenceOracle_->onPresenceChange(jid1Offline, jid1Online);
boost::shared_ptr<Presence> jid2Online(new Presence());
jid2Online->setFrom(JID(messageJID2));
boost::shared_ptr<Presence> jid2Offline(new Presence());
jid2Offline->setFrom(JID(messageJID2));
jid2Offline->setType(Presence::Unavailable);
- presenceOracle_->onPresenceChange(jid2Online, jid2Offline);
+ presenceOracle_->onPresenceChange(jid2Offline, jid2Online);
JID messageJID3("testling@test.com/resource3");