summaryrefslogtreecommitdiff
path: root/protocols/Discord
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-26 15:23:19 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-26 15:23:19 +0300
commitda1b2a070c113222cbbad31b18ab704c7d1301b2 (patch)
tree841092328c9c7fb35c3454627296862a956f5d5c /protocols/Discord
parentbe1918c1b2986ddb387cd593deddf120f9e61874 (diff)
Chat_AddGroup - simplified prototype
Diffstat (limited to 'protocols/Discord')
-rw-r--r--protocols/Discord/src/dispatch.cpp2
-rw-r--r--protocols/Discord/src/groupchat.cpp6
-rw-r--r--protocols/Discord/src/guilds.cpp4
-rw-r--r--protocols/Discord/src/proto.h2
4 files changed, 7 insertions, 7 deletions
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<CDiscordProto>
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);