summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src/communication.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-10-20 15:13:37 +0000
committerRobert Pösel <robyer@seznam.cz>2015-10-20 15:13:37 +0000
commit7d1babb61cffcf4c376463053397e3b11659f349 (patch)
treeb8249b332a665b5d95a413d92b3729cd138be2cf /protocols/Omegle/src/communication.cpp
parent7d1d2dad298eb1fb008c3116dc7c62dda051645b (diff)
Omegle: Various improvements; version bump
* Show icon with typing info in statusbar * Don't send "hi message" when in mode for anwering questions * Clear typing info on more events (e.g. on spy message) * Fix icons labels in icolib * Fix help messages * Show which stranger is typing in spy mode git-svn-id: http://svn.miranda-ng.org/main/trunk@15582 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Omegle/src/communication.cpp')
-rw-r--r--protocols/Omegle/src/communication.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp
index 9146e309a4..ba8d28d9d8 100644
--- a/protocols/Omegle/src/communication.cpp
+++ b/protocols/Omegle/src/communication.cpp
@@ -557,9 +557,10 @@ bool Omegle_client::events()
StatusTextData st = { 0 };
st.cbSize = sizeof(st);
- // st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_on")); // TODO: typing icon
+ st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_on"));
- mir_sntprintf(st.tszText, TranslateT("%s is typing."), TranslateT("Stranger"));
+ ptrT who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_tstrdup(_T("Stranger")));
+ mir_sntprintf(st.tszText, TranslateT("%s is typing."), TranslateTS(who));
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st);
}
@@ -569,13 +570,16 @@ bool Omegle_client::events()
StatusTextData st = { 0 };
st.cbSize = sizeof(st);
- // st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_off")); // TODO: typing icon
+ st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_off"));
- mir_sntprintf(st.tszText, TranslateT("%s stopped typing."), TranslateT("Stranger"));
+ ptrT who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_tstrdup(_T("Stranger")));
+ mir_sntprintf(st.tszText, TranslateT("%s stopped typing."), TranslateTS(who));
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st);
}
else if (name == "gotMessage") {
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), NULL);
+
// Play sound as we received message
SkinPlaySound("StrangerMessage");
@@ -583,10 +587,10 @@ bool Omegle_client::events()
ptrT msg(json_as_string(json_at(item, 1)));
parent->UpdateChat(TranslateT("Stranger"), msg);
}
-
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), 0);
}
else if (name == "spyMessage") {
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), NULL);
+
// Play sound as we received message
SkinPlaySound("StrangerMessage");
@@ -609,6 +613,8 @@ bool Omegle_client::events()
parent->StopChat(false);
}
else if (name == "spyDisconnected") {
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), NULL);
+
ptrT stranger(json_as_string(json_at(item, 1)));
TCHAR strT[255];
@@ -642,7 +648,7 @@ bool Omegle_client::events()
}
}
- if (newStranger && state_ != STATE_SPY) {
+ if (newStranger && !spy_mode_) {
// We got new stranger in this event, lets say him "Hi message" if enabled
if (db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_HI_ENABLED, 0)) {
DBVARIANT dbv;