feat(Core/Opcodes): Implement CMSG_CHANNEL_MODERATE (#4021)

* Core/Opcodes: Implement CMSG_CHANNEL_MODERATE

* Cleanup, prettify

* fix build

* whitespaces
This commit is contained in:
FALL1N1
2021-01-18 20:37:50 +02:00
committed by GitHub
parent 72f2a7706e
commit 0181b73bc2
8 changed files with 86 additions and 4 deletions

View File

@@ -277,13 +277,28 @@ void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket)
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_ANNOUNCEMENTS %s Channel: %s",
GetPlayerInfo().c_str(), channelName.c_str());
GetPlayerInfo().c_str(), channelName.c_str());
#endif
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId()))
if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer()))
channel->Announce(GetPlayer());
}
void WorldSession::HandleChannelModerateOpcode(WorldPacket& recvPacket)
{
std::string channelName;
recvPacket >> channelName;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_MODERATE %s Channel: %s",
GetPlayerInfo().c_str(), channelName.c_str());
#endif
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId()))
if (Channel* chn = cMgr->GetChannel(channelName, GetPlayer()))
chn->ToggleModeration(GetPlayer());
}
void WorldSession::HandleChannelDisplayListQuery(WorldPacket& recvPacket)
{
// this should be OK because the 2 function _were_ the same