diff options
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r-- | protocols/FacebookRM/src/chat.cpp | 6 | ||||
-rw-r--r-- | protocols/FacebookRM/src/messages.cpp | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index 872485107e..82f5368c62 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -26,9 +26,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. void FacebookProto::UpdateChat(const TCHAR *tchat_id, const char *id, const char *name, const char *message, DWORD timestamp)
{
+ // replace % to %% to not interfere with chat color codes
+ std::string smessage = message;
+ utils::text::replace_all(&smessage, "%", "%%");
+
ptrT tid( mir_a2t(id));
ptrT tnick( mir_a2t_cp(name,CP_UTF8));
- ptrT ttext( mir_a2t_cp(message,CP_UTF8));
+ ptrT ttext( mir_a2t_cp(smessage.c_str(),CP_UTF8));
GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_MESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp index f54312b8d6..559377c02d 100644 --- a/protocols/FacebookRM/src/messages.cpp +++ b/protocols/FacebookRM/src/messages.cpp @@ -80,6 +80,9 @@ void FacebookProto::SendChatMsgWorker(void *p) send_chat *data = static_cast<send_chat*>(p);
std::string err_message = "";
+ // replace %% back to %, because chat automatically does this to sent messages
+ utils::text::replace_all(&data->msg, "%%", "%");
+
MCONTACT hContact = ChatIDToHContact(std::tstring(_A2T(data->chat_id.c_str())));
if (hContact) {
std::string tid;
|