diff options
Diffstat (limited to 'protocols/MinecraftDynmap/src')
-rw-r--r-- | protocols/MinecraftDynmap/src/chat.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
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); |