diff --git a/source/glest_game/menu/menu_state_masterserver.cpp b/source/glest_game/menu/menu_state_masterserver.cpp index 76bb24b54..f6869e1b3 100644 --- a/source/glest_game/menu/menu_state_masterserver.cpp +++ b/source/glest_game/menu/menu_state_masterserver.cpp @@ -772,12 +772,23 @@ namespace Glest { "In [%s::%s Line: %d]\n", extractFileFromDirectoryPath(__FILE__). c_str(), __FUNCTION__, __LINE__); + + // code to execute when someone leaves the lobby if (ircClient != NULL && ircClient->isConnected() == true && ircClient->getHasJoinedChannel() == true) { - ircClient->SendIRCCmdMessage(IRC_CHANNEL, - " has left the lobby"); + /* The discord-irc bot + * already prints this message because + * it's sent using NOTICE or whatever from IRC directly + * + * The only reason it would be useful is to provide an extra alert + * to users in the channel on IRC, if they have extra notifications + * enabled + * + ircClient->SendIRCCmdMessage(IRC_CHANNEL, " has left the lobby"); + */ sleep(30); } + cleanup(); if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem). diff --git a/source/shared_lib/sources/platform/posix/ircclient.cpp b/source/shared_lib/sources/platform/posix/ircclient.cpp index 33e703de2..721049e39 100644 --- a/source/shared_lib/sources/platform/posix/ircclient.cpp +++ b/source/shared_lib/sources/platform/posix/ircclient.cpp @@ -176,10 +176,20 @@ namespace Shared { if (SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf("===> IRC: Line: %d\n", __LINE__); - //irc_cmd_msg (session, params[0], "ZG Bot says hello!"); + // code to execute when someone joins the lobby can be put here. ctx->setHasJoinedChannel(true); + + /* The discord-irc bot + * already prints this message because + * it's sent using NOTICE or whatever from IRC directly + * + * The only reason it would be useful is to provide an extra alert + * to users in the channel on IRC, if they have extra notifications + * enabled + * const char *announceJoin = { "has joined" }; irc_cmd_msg(session, "#zetaglest-lobby", announceJoin); + */ if (SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf("===> IRC: Line: %d\n", __LINE__);