summaryrefslogtreecommitdiff
path: root/protocols/Discord/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-27 14:52:20 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-27 14:52:20 +0300
commit66ab99eb5b5c47a01e1cc6613af07426abbeb19b (patch)
tree6b3a84cf91b9e383f348355d702e4b38ff1be1e8 /protocols/Discord/src
parent38d70bf8d8d08cc687263b83ab598279d36a9c56 (diff)
unused variable CHAT_MANAGER *pci removed and replaced with g_chatApi
Diffstat (limited to 'protocols/Discord/src')
-rw-r--r--protocols/Discord/src/dispatch.cpp10
-rw-r--r--protocols/Discord/src/main.cpp3
-rw-r--r--protocols/Discord/src/server.cpp2
-rw-r--r--protocols/Discord/src/utils.cpp2
4 files changed, 7 insertions, 10 deletions
diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp
index aa31c69f5f..2ee6930721 100644
--- a/protocols/Discord/src/dispatch.cpp
+++ b/protocols/Discord/src/dispatch.cpp
@@ -252,9 +252,9 @@ void CDiscordProto::OnCommandGuildMemberUpdated(const JSONNode &pRoot)
continue;
CMStringW wszOldNick;
- SESSION_INFO *si = pci->SM_FindSession(it->wszUsername, m_szModuleName);
+ SESSION_INFO *si = g_chatApi.SM_FindSession(it->wszUsername, m_szModuleName);
if (si != nullptr) {
- USERINFO *ui = pci->UM_FindUser(si->pUsers, wszUserId);
+ USERINFO *ui = g_chatApi.UM_FindUser(si->pUsers, wszUserId);
if (ui != nullptr)
wszOldNick = ui->pszNick;
}
@@ -300,9 +300,9 @@ void CDiscordProto::OnCommandRoleDeleted(const JSONNode &pRoot)
if (it->guildId != pGuild->id)
continue;
- SESSION_INFO *si = pci->SM_FindSession(it->wszUsername, m_szModuleName);
+ SESSION_INFO *si = g_chatApi.SM_FindSession(it->wszUsername, m_szModuleName);
if (si != nullptr) {
- pci->TM_RemoveAll(&si->pStatuses);
+ g_chatApi.TM_RemoveAll(&si->pStatuses);
BuildStatusList(pGuild, it->wszUsername);
}
}
@@ -358,7 +358,7 @@ void CDiscordProto::OnCommandMessage(const JSONNode &pRoot)
else {
debugLogA("store a message into the group channel id %lld", channelId);
- SESSION_INFO *si = pci->SM_FindSession(pUser->wszUsername, m_szModuleName);
+ SESSION_INFO *si = g_chatApi.SM_FindSession(pUser->wszUsername, m_szModuleName);
if (si == nullptr) {
debugLogA("message to unknown channel %lld ignored", channelId);
return;
diff --git a/protocols/Discord/src/main.cpp b/protocols/Discord/src/main.cpp
index e72f02b6a8..1dc83a4ce3 100644
--- a/protocols/Discord/src/main.cpp
+++ b/protocols/Discord/src/main.cpp
@@ -17,7 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-CHAT_MANAGER *pci;
CMPlugin g_plugin;
HWND g_hwndHeartbeat;
@@ -59,8 +58,6 @@ IconItem g_iconList[] =
extern "C" int __declspec(dllexport) Load(void)
{
- pci = Chat_GetInterface();
-
g_hwndHeartbeat = CreateWindowEx(0, L"STATIC", nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr);
g_plugin.registerIcon("Discord", g_iconList);
diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp
index 5a3a41f99b..1fc868642f 100644
--- a/protocols/Discord/src/server.cpp
+++ b/protocols/Discord/src/server.cpp
@@ -65,7 +65,7 @@ void CDiscordProto::OnReceiveHistory(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest
SESSION_INFO *si = nullptr;
if (!pUser->bIsPrivate) {
- si = pci->SM_FindSession(pUser->wszUsername, m_szModuleName);
+ si = g_chatApi.SM_FindSession(pUser->wszUsername, m_szModuleName);
if (si == nullptr) {
debugLogA("nessage to unknown channal %lld ignored", pUser->channelId);
return;
diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp
index cd890f2514..e1867992db 100644
--- a/protocols/Discord/src/utils.cpp
+++ b/protocols/Discord/src/utils.cpp
@@ -265,7 +265,7 @@ void CDiscordProto::ParseSpecialChars(SESSION_INFO *si, CMStringW &str)
if (wszWord[1] == '!')
iStart++;
- USERINFO *ui = pci->UM_FindUser(si->pUsers, wszWord.c_str() + iStart);
+ USERINFO *ui = g_chatApi.UM_FindUser(si->pUsers, wszWord.c_str() + iStart);
if (ui != nullptr)
str.Replace(L"<" + wszWord + L">", CMStringW('@') + ui->pszNick);
}