diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-09-06 10:31:55 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-09-06 10:31:55 +0000 |
commit | f2930f05aeb9810fcc532aad8d4742445999c597 (patch) | |
tree | 18ac9a37de63fb5ad265361f86e08a7291a66bca /protocols/SkypeWeb | |
parent | aeaa92e5fc1f713ff96122e15321ba11dd0609db (diff) |
SkypeWeb: chatrooms fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15285 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 5cd6536814..7f00bcd8e7 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -396,12 +396,30 @@ void CSkypeProto::OnChatEvent(const JSONNode &node) }
}
+TCHAR* UnEscapeChatTags(TCHAR* str_in)
+{
+ TCHAR *s = str_in, *d = str_in;
+ while (*s) {
+ if (*s == '%' && s[1] == '%')
+ s++;
+ *d++ = *s++;
+ }
+ *d = 0;
+ return str_in;
+}
+
void CSkypeProto::OnSendChatMessage(const TCHAR *chat_id, const TCHAR * tszMessage)
{
if (!IsOnline())
return;
+
+ TCHAR *buf = NEWTSTR_ALLOCA(tszMessage);
+ rtrimt(buf);
+ UnEscapeChatTags(buf);
+
ptrA szChatId(mir_t2a(chat_id));
- ptrA szMessage(mir_utf8encodeT(tszMessage));
+ ptrA szMessage(mir_utf8encodeT(buf));
+
if (strncmp(szMessage, "/me ", 4) == 0)
SendRequest(new SendChatActionRequest(szChatId, time(NULL), szMessage, li));
else
@@ -418,7 +436,8 @@ void CSkypeProto::AddMessageToChat(const TCHAR *chat_id, const TCHAR *from, cons gce.time = timestamp;
gce.ptszUID = from;
ptrA szHtml(RemoveHtml(content));
- ptrT tszHtml(mir_utf8decodeT(szHtml));
+ CMString tszHtml(mir_utf8decodeT(szHtml));
+ tszHtml.Replace(L"%", L"%%");
if (!isAction)
{
gce.ptszText = tszHtml;
@@ -426,7 +445,7 @@ void CSkypeProto::AddMessageToChat(const TCHAR *chat_id, const TCHAR *from, cons }
else
{
- gce.ptszText = &tszHtml[emoteOffset];
+ gce.ptszText = &tszHtml.GetBuffer()[emoteOffset];
}
if (isLoading) gce.dwFlags = GCEF_NOTNOTIFY;
|