summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-08-15 13:49:37 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-08-15 13:49:37 +0300
commitf52b5cc86d9eff2494902157c8fc0a4e019a3c95 (patch)
tree9f668bf7b89decd53757589d74e476aac81eb451 /protocols/Omegle/src
parentd05dd78157058eea348f0d7666c7c6b0570ef25b (diff)
fixes #799 (Crash on receiving msg in FB group chat)
Diffstat (limited to 'protocols/Omegle/src')
-rw-r--r--protocols/Omegle/src/communication.cpp26
-rw-r--r--protocols/Omegle/src/connection.cpp2
2 files changed, 11 insertions, 17 deletions
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp
index 527a42705f..65baff0dee 100644
--- a/protocols/Omegle/src/communication.cpp
+++ b/protocols/Omegle/src/communication.cpp
@@ -552,28 +552,22 @@ bool Omegle_client::events()
// Stranger is typing, not supported by chat module yet
SkinPlaySound("StrangerTyp");
- StatusTextData st = { 0 };
- st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_on"));
-
ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger"));
- mir_snwprintf(st.tszText, TranslateT("%s is typing."), TranslateW(who));
-
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st);
+ Srmm_SetStatusText(parent->GetChatHandle(),
+ CMStringW(FORMAT, TranslateT("%s is typing."), TranslateW(who)),
+ IcoLib_GetIconByHandle(GetIconHandle("typing_on")));
}
else if (name == "stoppedTyping" || name == "spyStoppedTyping") {
// Stranger stopped typing, not supported by chat module yet
SkinPlaySound("StrangerTypStop");
- StatusTextData st = { 0 };
- st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_off"));
-
ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger"));
- mir_snwprintf(st.tszText, TranslateT("%s stopped typing."), TranslateW(who));
-
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st);
+ Srmm_SetStatusText(parent->GetChatHandle(),
+ CMStringW(FORMAT, TranslateT("%s stopped typing."), TranslateW(who)),
+ IcoLib_GetIconByHandle(GetIconHandle("typing_off")));
}
else if (name == "gotMessage") {
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), NULL);
+ Srmm_SetStatusText(parent->GetChatHandle(), nullptr);
// Play sound as we received message
SkinPlaySound("StrangerMessage");
@@ -584,7 +578,7 @@ bool Omegle_client::events()
}
}
else if (name == "spyMessage") {
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), NULL);
+ Srmm_SetStatusText(parent->GetChatHandle(), nullptr);
// Play sound as we received message
SkinPlaySound("StrangerMessage");
@@ -596,7 +590,7 @@ bool Omegle_client::events()
}
}
else if (name == "strangerDisconnected") {
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), NULL);
+ Srmm_SetStatusText(parent->GetChatHandle(), nullptr);
// Stranger disconnected
if (db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_DONT_STOP, 0))
@@ -608,7 +602,7 @@ bool Omegle_client::events()
parent->StopChat(false);
}
else if (name == "spyDisconnected") {
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), NULL);
+ Srmm_SetStatusText(parent->GetChatHandle(), nullptr);
ptrW stranger(json_as_string(json_at(item, 1)));
diff --git a/protocols/Omegle/src/connection.cpp b/protocols/Omegle/src/connection.cpp
index 50aa33a759..361820f2b5 100644
--- a/protocols/Omegle/src/connection.cpp
+++ b/protocols/Omegle/src/connection.cpp
@@ -96,7 +96,7 @@ void OmegleProto::StopChat(bool disconnect)
SetTopic(); // reset topic content
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)GetChatHandle(), NULL);
+ Srmm_SetStatusText(GetChatHandle(), nullptr);
}
else
{ // disconnecting or inactive