diff options
-rw-r--r-- | include/m_chat.h | 1 | ||||
-rw-r--r-- | protocols/MinecraftDynmap/src/chat.cpp | 25 | ||||
-rw-r--r-- | protocols/Omegle/src/chat.cpp | 1 |
3 files changed, 11 insertions, 16 deletions
diff --git a/include/m_chat.h b/include/m_chat.h index 818883ff62..cb806681a6 100644 --- a/include/m_chat.h +++ b/include/m_chat.h @@ -471,7 +471,6 @@ EXTERN_C MIR_APP_DLL(int) Chat_GetInfo(GC_INFO*); #define GC_USER_TYPNOTIFY 5 // NOT IMPLEMENTED YET! user is typing
#define GC_USER_PRIVMESS 6 // user requests to send a private message to a user. pszUID is valid
#define GC_SESSION_TERMINATE 7 // the session is about to be terminated, the "user defined data" is passed in dwData, which can be good free'ing any allocated memory.
-#define GC_USER_LEAVE 8 // user requests to leave the session
#define GC_USER_CLOSEWND 9 // user closed the window (this is usually not an indication that the protocol
// should take action, but MSN may want to terminate the session here)
#define ME_GC_EVENT "GChat/OutgoingEvent"
diff --git a/protocols/MinecraftDynmap/src/chat.cpp b/protocols/MinecraftDynmap/src/chat.cpp index 96de40051e..7e267dda79 100644 --- a/protocols/MinecraftDynmap/src/chat.cpp +++ b/protocols/MinecraftDynmap/src/chat.cpp @@ -56,26 +56,23 @@ int MinecraftDynmapProto::OnChatEvent(WPARAM, LPARAM lParam) if(strcmp(hook->pszModule,m_szModuleName)) return 0; - switch(hook->iType) - { + switch(hook->iType) { case GC_USER_MESSAGE: - { - std::string text = mir_u2a_cp(hook->ptszText,CP_UTF8); - - // replace %% back to %, because chat automatically does this to sent messages - utils::text::replace_all(&text, "%%", "%"); + { + std::string text = mir_u2a_cp(hook->ptszText, CP_UTF8); - if (text.empty()) - break; + // replace %% back to %, because chat automatically does this to sent messages + utils::text::replace_all(&text, "%%", "%"); - // Outgoing message - debugLogA("**Chat - Outgoing message: %s", text.c_str()); - ForkThread(&MinecraftDynmapProto::SendMsgWorker, new std::string(text)); + if (text.empty()) + break; + // Outgoing message + debugLogA("**Chat - Outgoing message: %s", text.c_str()); + ForkThread(&MinecraftDynmapProto::SendMsgWorker, new std::string(text)); + } break; - } - case GC_USER_LEAVE: case GC_SESSION_TERMINATE: m_nick.clear(); SetStatus(ID_STATUS_OFFLINE); diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp index 152966e8cd..0b37532c8d 100644 --- a/protocols/Omegle/src/chat.cpp +++ b/protocols/Omegle/src/chat.cpp @@ -175,7 +175,6 @@ int OmegleProto::OnChatEvent(WPARAM, LPARAM lParam) }
break;
- case GC_USER_LEAVE:
case GC_SESSION_TERMINATE:
facy.nick_ = nullptr;
ForkThread(&OmegleProto::StopChatWorker, nullptr);
|