Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
2510538d
Commit
2510538d
authored
Sep 08, 2010
by
Alexandre Savard
Browse files
[#3963] Parse data in SIP message to retreive actual Text Message
parent
aaa76da5
Changes
2
Hide whitespace changes
Inline
Side-by-side
sflphone-common/src/sip/im/InstantMessaging.cpp
View file @
2510538d
...
...
@@ -300,10 +300,11 @@ std::string InstantMessaging::appendUriList (std::string text, UriList& list)
return
formatedText
;
}
std
::
string
InstantMessaging
::
findTextUriList
(
std
::
string
text
)
std
::
string
InstantMessaging
::
findTextUriList
(
std
::
string
&
text
)
{
std
::
string
ctype
=
"Content-Type: application/resource-lists+xml"
;
std
::
string
cdispo
=
"Content-Disposition: recipient-list"
;
std
::
string
boundary
=
(
"--boundary--"
);
size_t
pos
=
0
;
pos
=
text
.
find
(
ctype
);
...
...
@@ -311,12 +312,12 @@ std::string InstantMessaging::findTextUriList (std::string text)
size_t
begin
=
pos
+
cdispo
.
size
();
size_t
end
=
text
.
find
(
"--
boundary
--"
,
begin
);
size_t
end
=
text
.
find
(
boundary
,
begin
);
return
text
.
substr
(
begin
,
end
-
begin
);
}
std
::
string
InstantMessaging
::
findTextMessage
(
std
::
string
text
)
std
::
string
InstantMessaging
::
findTextMessage
(
std
::
string
&
text
)
{
std
::
string
ctype
=
"Content-Type: text/plain"
;
std
::
string
boundary
=
"--boundary"
;
...
...
sflphone-common/src/sip/im/InstantMessaging.h
View file @
2510538d
...
...
@@ -155,9 +155,23 @@ class InstantMessaging
*/
std
::
string
appendUriList
(
std
::
string
text
,
UriList
&
list
);
std
::
string
findTextUriList
(
std
::
string
text
);
std
::
string
findTextMessage
(
std
::
string
text
);
/**
* Retreive the xml formated uri list in formated text data according to RFC 5365
*
* @param text The formated text message as retreived in the SIP message
*
* @return A string containing the XML content
*/
std
::
string
findTextUriList
(
std
::
string
&
text
);
/**
* Retrive the plain text message in formated text data according to RFC 5365
*
* @param text The formated text message as retreived in the SIP message
*
* @return A string containing the actual message
*/
std
::
string
findTextMessage
(
std
::
string
&
text
);
private:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment