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
7558f283
Commit
7558f283
authored
Sep 07, 2010
by
Alexandre Savard
Browse files
[#3963] Find text field and recipient-list in instant messages
parent
454b3254
Changes
2
Hide whitespace changes
Inline
Side-by-side
sflphone-common/src/sip/im/InstantMessaging.cpp
View file @
7558f283
...
...
@@ -285,7 +285,7 @@ InstantMessaging::UriList InstantMessaging::parseXmlUriList (std::string& urilis
std
::
string
InstantMessaging
::
appendUriList
(
std
::
string
text
,
UriList
&
list
)
{
std
::
string
formatedText
=
"--boundary
\n
Content-Type: text/plain
\n\n
"
;
std
::
string
formatedText
=
"--boundary
\n
Content-Type: text/plain
\n\n
"
;
formatedText
.
append
(
text
);
formatedText
.
append
(
"
\n
--boundary
\n
Content-Type: application/resource-lists+xml
\n
"
);
...
...
@@ -300,4 +300,35 @@ std::string InstantMessaging::appendUriList (std::string text, UriList& list)
return
formatedText
;
}
std
::
string
InstantMessaging
::
findTextUriList
(
std
::
string
text
)
{
std
::
string
ctype
=
"Content-Type: application/resource-lists+xml"
;
std
::
string
cdispo
=
"Content-Disposition: recipient-list"
;
size_t
pos
=
0
;
pos
=
text
.
find
(
ctype
);
pos
=
text
.
find
(
cdispo
,
pos
);
size_t
begin
=
pos
+
cdispo
.
size
();
size_t
end
=
text
.
find
(
"--boundary1--"
,
begin
);
return
text
.
substr
(
begin
,
end
);
}
std
::
string
InstantMessaging
::
findTextMessage
(
std
::
string
text
)
{
std
::
string
ctype
=
"Content-Type: text/plain"
;
std
::
string
boundary
=
"--boundary"
;
size_t
pos
=
0
;
pos
=
text
.
find
(
ctype
);
size_t
begin
=
pos
+
ctype
.
size
();
size_t
end
=
text
.
find
(
boundary
,
begin
);
return
text
.
substr
(
begin
,
end
);
}
}
sflphone-common/src/sip/im/InstantMessaging.h
View file @
7558f283
...
...
@@ -155,6 +155,10 @@ class InstantMessaging
*/
std
::
string
appendUriList
(
std
::
string
text
,
UriList
&
list
);
std
::
string
findTextUriList
(
std
::
string
text
);
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