Commit 9c7828d9 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

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

parent 46695d5a
......@@ -314,7 +314,7 @@ std::string InstantMessaging::findTextUriList (std::string& text)
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)
......@@ -328,7 +328,7 @@ std::string InstantMessaging::findTextMessage (std::string& text)
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 ()
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;
}
......@@ -308,7 +308,7 @@ void InstantMessagingTest::testGetUriListArea ()
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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment