summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-10-27 16:20:09 (GMT)
committerTobias Markmann <tm@ayena.de>2015-10-30 12:34:52 (GMT)
commit0f5ef716a50c8d9761cafda12aacf818cdfd6353 (patch)
tree4ed80dedc2fa8b04036eb7567282094ea8fe07f1 /Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp
parent4320235bef1b601856b295a8d6411d1898048802 (diff)
downloadswift-0f5ef716a50c8d9761cafda12aacf818cdfd6353.zip
swift-0f5ef716a50c8d9761cafda12aacf818cdfd6353.tar.bz2
Change bare JID presence lookup code to ignore priorities
Before presence handling code was handled by both, the ContactRosterItem in Swift and the PresenceOracle in Swiften. The ContactRosterItem also considered the presence priority for deciding what presence to show for a bare JID. With this code all full or bare JID presence requests are finally handled by the PresenceOracle. For bare JIDs it is looked up to a presence of one of the available resources of that JID regardless of the priorities. Test-Information: Adjusted tests according to above description and documentation in PresenceOracle. Change-Id: I972a4574f476cdf4d4b5593a035eb1c25ef2f8ba
Diffstat (limited to 'Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp')
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp
index 05aaedf..56143ef 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp
@@ -11,20 +11,19 @@
11 */ 11 */
12 12
13#include <cppunit/extensions/HelperMacros.h> 13#include <cppunit/extensions/HelperMacros.h>
14#include <cppunit/extensions/TestFactoryRegistry.h> 14#include <cppunit/extensions/TestFactoryRegistry.h>
15 15
16#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h> 16#include <Swiften/Base/DateTime.h>
17#include <Swiften/Elements/JinglePayload.h> 17#include <Swiften/Elements/JingleFileTransferDescription.h>
18#include <Swiften/Elements/JingleFileTransferHash.h>
18#include <Swiften/Elements/JingleIBBTransportPayload.h> 19#include <Swiften/Elements/JingleIBBTransportPayload.h>
20#include <Swiften/Elements/JinglePayload.h>
19#include <Swiften/Elements/JingleS5BTransportPayload.h> 21#include <Swiften/Elements/JingleS5BTransportPayload.h>
20#include <Swiften/Elements/JingleFileTransferDescription.h>
21#include <Swiften/Elements/StreamInitiationFileInfo.h> 22#include <Swiften/Elements/StreamInitiationFileInfo.h>
22#include <Swiften/Elements/JingleFileTransferHash.h> 23#include <Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h>
23#include <Swiften/Base/DateTime.h>
24#include <Swiften/StringCodecs/Base64.h> 24#include <Swiften/StringCodecs/Base64.h>
25#include <Swiften/Base/Log.h>
26 25
27using namespace Swift; 26using namespace Swift;
28 27
29class JingleParserTest : public CppUnit::TestFixture { 28class JingleParserTest : public CppUnit::TestFixture {
30 CPPUNIT_TEST_SUITE(JingleParserTest); 29 CPPUNIT_TEST_SUITE(JingleParserTest);
@@ -411,11 +410,10 @@ class JingleParserTest : public CppUnit::TestFixture {
411 CPPUNIT_ASSERT_EQUAL(std::string("VS2nSZMIUsaa5dIUHTdmsQ=="), Base64::encode(hash->getFileInfo().getHash("sha-1").get())); 410 CPPUNIT_ASSERT_EQUAL(std::string("VS2nSZMIUsaa5dIUHTdmsQ=="), Base64::encode(hash->getFileInfo().getHash("sha-1").get()));
412 } 411 }
413 412
414 // http://xmpp.org/extensions/xep-0234.html#example-10 413 // http://xmpp.org/extensions/xep-0234.html#example-10
415 void testParse_Xep0234_Example10() { 414 void testParse_Xep0234_Example10() {
416 Log::setLogLevel(Log::debug);
417 PayloadsParserTester parser; 415 PayloadsParserTester parser;
418 CPPUNIT_ASSERT(parser.parse( 416 CPPUNIT_ASSERT(parser.parse(
419 "<jingle xmlns='urn:xmpp:jingle:1'\n" 417 "<jingle xmlns='urn:xmpp:jingle:1'\n"
420 " action='session-initiate'\n" 418 " action='session-initiate'\n"
421 " initiator='romeo@montague.lit/orchard'\n" 419 " initiator='romeo@montague.lit/orchard'\n"