Skip to content
Snippets Groups Projects
Commit 9c7828d9 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3963] Fix instant message parsing (text/plain & recipient-list)

parent 46695d5a
No related branches found
No related tags found
No related merge requests found
...@@ -314,7 +314,7 @@ std::string InstantMessaging::findTextUriList (std::string& text) ...@@ -314,7 +314,7 @@ std::string InstantMessaging::findTextUriList (std::string& text)
size_t end = text.find (boundary, begin); size_t end = text.find (boundary, begin);
return text.substr (begin+2, end-begin); return text.substr (begin+2, end-begin-2);
} }
std::string InstantMessaging::findTextMessage (std::string& text) std::string InstantMessaging::findTextMessage (std::string& text)
...@@ -328,7 +328,7 @@ std::string InstantMessaging::findTextMessage (std::string& text) ...@@ -328,7 +328,7 @@ std::string InstantMessaging::findTextMessage (std::string& text)
size_t end = text.find (boundary, begin); size_t end = text.find (boundary, begin);
return text.substr (begin+2, end-begin); return text.substr (begin+2, end-begin-3);
} }
......
...@@ -284,7 +284,7 @@ void InstantMessagingTest::testGetTextArea () ...@@ -284,7 +284,7 @@ void InstantMessagingTest::testGetTextArea ()
std::string message = _im->findTextMessage(formatedText); std::string message = _im->findTextMessage(formatedText);
// CPPUNIT_ASSERT(message == "Here is the text area"); CPPUNIT_ASSERT(message == "Here is the text area");
std::cout << "message: " << message << std::endl; std::cout << "message: " << message << std::endl;
} }
...@@ -308,7 +308,7 @@ void InstantMessagingTest::testGetUriListArea () ...@@ -308,7 +308,7 @@ void InstantMessagingTest::testGetUriListArea ()
std::string urilist = _im->findTextUriList(formatedText); std::string urilist = _im->findTextUriList(formatedText);
// CPPUNIT_ASSERT(urilist.compare("<?xml version=\"1.0\" encoding=\"UTF-8\"?><resource-lists xmlns=\"urn:ietf:params:xml:ns:resource-lists\" xmlns:cp=\"urn:ietf:params:xml:ns:copycontrol\"><list><entry uri=\"sip:alex@example.com\" cp:copyControl=\"to\" /><entry uri=\"sip:manu@example.com\" cp:copyControl=\"to\" /></list></resource-lists>") == 0); CPPUNIT_ASSERT(urilist.compare("<?xml version=\"1.0\" encoding=\"UTF-8\"?><resource-lists xmlns=\"urn:ietf:params:xml:ns:resource-lists\" xmlns:cp=\"urn:ietf:params:xml:ns:copycontrol\"><list><entry uri=\"sip:alex@example.com\" cp:copyControl=\"to\" /><entry uri=\"sip:manu@example.com\" cp:copyControl=\"to\" /></list></resource-lists>") == 0);
std::cout << "urilist: " << urilist << std::endl; std::cout << "urilist: " << urilist << std::endl;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment