From e0a33a79c1c01bf16ff009224376ff04f61a217b Mon Sep 17 00:00:00 2001 From: Kevin Smith <git@kismith.co.uk> Date: Mon, 28 Nov 2011 18:07:56 +0000 Subject: Cleanup after previous patch diff --git a/COPYING b/COPYING index 6244d87..02916a6 100644 --- a/COPYING +++ b/COPYING @@ -827,6 +827,8 @@ Copyright (c) 2011, Arnt Gulbrandsen Copyright (c) 2011, Thilo Cestonaro Copyright (c) 2011, Vlad Voicu Copyright (c) 2011, Jan Kaluza +Copyright (c) 2011, Tobias Markmann +Copyright (c) 2011, Soren Dreijer All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index 8111c2b..61c3208 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -363,9 +363,9 @@ void ChatsManager::handleUIEvent(boost::shared_ptr<UIEvent> event) { mucBookmarkManager_->addBookmark(addMUCBookmarkEvent->getBookmark()); return; } - boost::shared_ptr<ToggleRequestDeliveryReceiptsUIEvent> toggleRequestDeliveryReceipsEvent = boost::dynamic_pointer_cast<ToggleRequestDeliveryReceiptsUIEvent>(event); - if (toggleRequestDeliveryReceipsEvent) { - userWantsReceipts_ = toggleRequestDeliveryReceipsEvent->getEnabled(); + boost::shared_ptr<ToggleRequestDeliveryReceiptsUIEvent> toggleRequestDeliveryReceiptsEvent = boost::dynamic_pointer_cast<ToggleRequestDeliveryReceiptsUIEvent>(event); + if (toggleRequestDeliveryReceiptsEvent) { + userWantsReceipts_ = toggleRequestDeliveryReceiptsEvent->getEnabled(); return; } diff --git a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp index edb431a..8162bec 100644 --- a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp +++ b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp @@ -358,14 +358,14 @@ public: boost::shared_ptr<Message> message = makeDeliveryReceiptTestMessage(messageJID, "1"); manager_->handleIncomingMessage(message); Stanza::ref stanzaContactOnRoster = stanzaChannel_->getStanzaAtIndex<Stanza>(0); - CPPUNIT_ASSERT_EQUAL((size_t)1, stanzaChannel_->sentStanzas.size()); + CPPUNIT_ASSERT_EQUAL(st(1), stanzaChannel_->sentStanzas.size()); CPPUNIT_ASSERT(stanzaContactOnRoster->getPayload<DeliveryReceipt>() != 0); xmppRoster_->removeContact(messageJID); message->setID("2"); manager_->handleIncomingMessage(message); - CPPUNIT_ASSERT_EQUAL((size_t)1, stanzaChannel_->sentStanzas.size()); + CPPUNIT_ASSERT_EQUAL(st(1), stanzaChannel_->sentStanzas.size()); } /** @@ -381,13 +381,13 @@ public: boost::shared_ptr<Message> message = makeDeliveryReceiptTestMessage(messageJID, "1"); manager_->handleIncomingMessage(message); - CPPUNIT_ASSERT_EQUAL((size_t)0, stanzaChannel_->sentStanzas.size()); + CPPUNIT_ASSERT_EQUAL(st(0), stanzaChannel_->sentStanzas.size()); xmppRoster_->addContact(messageJID, "foo", std::vector<std::string>(), RosterItemPayload::Both); message->setID("2"); manager_->handleIncomingMessage(message); - CPPUNIT_ASSERT_EQUAL((size_t)1, stanzaChannel_->sentStanzas.size()); + CPPUNIT_ASSERT_EQUAL(st(1), stanzaChannel_->sentStanzas.size()); Stanza::ref stanzaContactOnRoster = stanzaChannel_->getStanzaAtIndex<Stanza>(0); CPPUNIT_ASSERT(stanzaContactOnRoster->getPayload<DeliveryReceipt>() != 0); } @@ -417,13 +417,13 @@ public: boost::shared_ptr<Message> message = makeDeliveryReceiptTestMessage(messageJID, "1"); manager_->handleIncomingMessage(message); - CPPUNIT_ASSERT_EQUAL((size_t)0, stanzaChannel_->sentStanzas.size()); + CPPUNIT_ASSERT_EQUAL(st(0), stanzaChannel_->sentStanzas.size()); xmppRoster_->addContact(messageJID, "foo", std::vector<std::string>(), to); message->setID("2"); manager_->handleIncomingMessage(message); - CPPUNIT_ASSERT_EQUAL((size_t)1, stanzaChannel_->sentStanzas.size()); + CPPUNIT_ASSERT_EQUAL(st(1), stanzaChannel_->sentStanzas.size()); Stanza::ref stanzaContactOnRoster = stanzaChannel_->getStanzaAtIndex<Stanza>(0); CPPUNIT_ASSERT(stanzaContactOnRoster->getPayload<DeliveryReceipt>() != 0); } @@ -437,6 +437,10 @@ private: return message; } + size_t st(int i) { + return static_cast<size_t>(i); + } + private: JID jid_; ChatsManager* manager_; -- cgit v0.10.2-6-g49f6