From da1b2a070c113222cbbad31b18ab704c7d1301b2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Nov 2018 15:23:19 +0300 Subject: Chat_AddGroup - simplified prototype --- protocols/Discord/src/dispatch.cpp | 2 +- protocols/Discord/src/groupchat.cpp | 6 +++--- protocols/Discord/src/guilds.cpp | 4 ++-- protocols/Discord/src/proto.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'protocols/Discord') diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp index 13687a4b5f..90457116c4 100644 --- a/protocols/Discord/src/dispatch.cpp +++ b/protocols/Discord/src/dispatch.cpp @@ -300,7 +300,7 @@ void CDiscordProto::OnCommandRoleDeleted(const JSONNode &pRoot) SESSION_INFO *si = g_chatApi.SM_FindSession(it->wszUsername, m_szModuleName); if (si != nullptr) { g_chatApi.TM_RemoveAll(&si->pStatuses); - BuildStatusList(pGuild, it->wszUsername); + BuildStatusList(pGuild, si); } } } diff --git a/protocols/Discord/src/groupchat.cpp b/protocols/Discord/src/groupchat.cpp index cc26dbb162..41351dee88 100644 --- a/protocols/Discord/src/groupchat.cpp +++ b/protocols/Discord/src/groupchat.cpp @@ -25,12 +25,12 @@ enum { ///////////////////////////////////////////////////////////////////////////////////////// -void CDiscordProto::BuildStatusList(const CDiscordGuild *pGuild, const CMStringW &wszChannelId) +void CDiscordProto::BuildStatusList(const CDiscordGuild *pGuild, SESSION_INFO *si) { - Chat_AddGroup(m_szModuleName, wszChannelId, L"@owner"); + Chat_AddGroup(si, L"@owner"); for (auto &it : pGuild->arRoles) - Chat_AddGroup(m_szModuleName, wszChannelId, it->wszName); + Chat_AddGroup(si, it->wszName); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp index cdaf29de05..639937b4c3 100644 --- a/protocols/Discord/src/guilds.cpp +++ b/protocols/Discord/src/guilds.cpp @@ -99,7 +99,7 @@ void CDiscordProto::CreateChat(CDiscordGuild *pGuild, CDiscordUser *pUser) else sttSetGroupName(pUser->hContact, Clist_GroupGetName(pGuild->groupId)); } - BuildStatusList(pGuild, pUser->wszUsername); + BuildStatusList(pGuild, si); Chat_Control(m_szModuleName, pUser->wszUsername, m_bHideGroupchats ? WINDOW_HIDDEN : SESSION_INITDONE); Chat_Control(m_szModuleName, pUser->wszUsername, SESSION_ONLINE); @@ -140,7 +140,7 @@ void CDiscordProto::ProcessGuild(const JSONNode &p) const JSONNode &roles = p["roles"]; for (auto itr = roles.begin(); itr != roles.end(); ++itr) ProcessRole(pGuild, *itr); - BuildStatusList(pGuild, pGuild->wszName); + BuildStatusList(pGuild, si); for (auto &it : pGuild->arChatUsers) AddGuildUser(pGuild, *it); diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h index 9f42b4ad58..4d51cdc161 100644 --- a/protocols/Discord/src/proto.h +++ b/protocols/Discord/src/proto.h @@ -251,7 +251,7 @@ class CDiscordProto : public PROTO void Chat_SendPrivateMessage(GCHOOK *gch); void Chat_ProcessLogMenu(GCHOOK *gch); - void BuildStatusList(const CDiscordGuild *pGuild, const CMStringW &wszChannelId); + void BuildStatusList(const CDiscordGuild *pGuild, SESSION_INFO *si); void CreateChat(CDiscordGuild *pGuild, CDiscordUser *pUser); void ParseSpecialChars(SESSION_INFO *si, CMStringW &str); -- cgit v1.2.3