summaryrefslogtreecommitdiff
path: root/protocols/Discord
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-01-25 14:24:53 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-01-25 14:24:53 +0300
commit9cca190bc3022311915eb1e95b3cc3bb89aed328 (patch)
treef0e27680e6dae1a0df044ae59ad86ccac59d0db7 /protocols/Discord
parentcf83f17e172253faf44737b8f4c27945e9f671e5 (diff)
massive code cleaning:
- GCHOOK structure normalized (i.e. inlined SESSION_INFO fields replaced with a reference to SESSION_INFO); - fake CMsgDialog declaration added to m_srmm_int.h, thus duplicated declarations in plugins aren't needed anymore - other minor changes
Diffstat (limited to 'protocols/Discord')
-rw-r--r--protocols/Discord/src/groupchat.cpp10
-rw-r--r--protocols/Discord/src/guilds.cpp5
2 files changed, 5 insertions, 10 deletions
diff --git a/protocols/Discord/src/groupchat.cpp b/protocols/Discord/src/groupchat.cpp
index c353879559..8b68a6a20b 100644
--- a/protocols/Discord/src/groupchat.cpp
+++ b/protocols/Discord/src/groupchat.cpp
@@ -80,7 +80,7 @@ void CDiscordProto::Chat_SendPrivateMessage(GCHOOK *gch)
return;
setId(hContact, DB_KEY_ID, userId);
- setId(hContact, DB_KEY_CHANNELID, _wtoi64(gch->ptszID));
+ setId(hContact, DB_KEY_CHANNELID, _wtoi64(gch->si->ptszID));
setWString(hContact, "Nick", gch->ptszNick);
Contact_Hide(hContact);
db_set_dw(hContact, "Ignore", "Mask1", 0);
@@ -92,7 +92,7 @@ void CDiscordProto::Chat_SendPrivateMessage(GCHOOK *gch)
void CDiscordProto::Chat_ProcessLogMenu(GCHOOK *gch)
{
- CDiscordUser *pUser = FindUserByChannel(_wtoi64(gch->ptszID));
+ CDiscordUser *pUser = FindUserByChannel(_wtoi64(gch->si->ptszID));
if (pUser == nullptr)
return;
@@ -152,7 +152,7 @@ int CDiscordProto::GroupchatEventHook(WPARAM, LPARAM lParam)
if (gch == nullptr)
return 0;
- if (mir_strcmpi(gch->pszModule, m_szModuleName))
+ if (mir_strcmpi(gch->si->pszModule, m_szModuleName))
return 0;
switch (gch->iType) {
@@ -165,7 +165,7 @@ int CDiscordProto::GroupchatEventHook(WPARAM, LPARAM lParam)
if (pos != -1) {
auto wszWord = wszText.Left(pos);
wszWord.Trim();
- if (auto *si = g_chatApi.SM_FindSession(gch->ptszID, gch->pszModule)) {
+ if (auto *si = g_chatApi.SM_FindSession(gch->si->ptszID, gch->si->pszModule)) {
USERINFO *pUser = nullptr;
for (auto &U : si->getUserList())
@@ -184,7 +184,7 @@ int CDiscordProto::GroupchatEventHook(WPARAM, LPARAM lParam)
Chat_UnescapeTags(wszText.GetBuffer());
JSONNode body; body << WCHAR_PARAM("content", wszText);
- CMStringA szUrl(FORMAT, "/channels/%S/messages", gch->ptszID);
+ CMStringA szUrl(FORMAT, "/channels/%S/messages", gch->si->ptszID);
Push(new AsyncHttpRequest(this, REQUEST_POST, szUrl, nullptr, &body));
}
break;
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp
index 3408141ecf..c19237c7e4 100644
--- a/protocols/Discord/src/guilds.cpp
+++ b/protocols/Discord/src/guilds.cpp
@@ -17,11 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-class CMsgDialog : public CSrmmBaseDialog
-{
- CMsgDialog(); // just to suppress compiler's warnings, never implemented
-};
-
int compareUsers(const CDiscordUser *p1, const CDiscordUser *p2);
static int compareRoles(const CDiscordRole *p1, const CDiscordRole *p2)