summaryrefslogtreecommitdiff
path: root/protocols
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
parent38d70bf8d8d08cc687263b83ab598279d36a9c56 (diff)
unused variable CHAT_MANAGER *pci removed and replaced with g_chatApi
Diffstat (limited to 'protocols')
-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
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp4
-rw-r--r--protocols/IRCG/src/main.cpp3
-rw-r--r--protocols/IRCG/src/scripting.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber.cpp4
-rw-r--r--protocols/SkypeWeb/src/main.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_chatrooms.cpp2
-rw-r--r--protocols/Tox/src/main.cpp4
11 files changed, 11 insertions, 27 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);
}
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index 081d6d6e0a..25e0c78060 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -96,7 +96,7 @@ VOID CALLBACK OnlineNotifTimerProc3(HWND, UINT, UINT_PTR idEvent, DWORD)
CMStringW name = GetWord(ppro->m_channelsToWho, 0);
if (name.IsEmpty()) {
ppro->m_channelsToWho = L"";
- int count = pci->SM_GetCount(ppro->m_szModuleName);
+ int count = g_chatApi.SM_GetCount(ppro->m_szModuleName);
for (int i = 0; i < count; i++) {
GC_INFO gci = { 0 };
gci.Flags = GCF_BYINDEX | GCF_NAME | GCF_TYPE | GCF_COUNT;
@@ -2353,7 +2353,7 @@ bool CIrcProto::DoOnConnect(const CIrcMessage*)
}
if (m_rejoinChannels) {
- int count = pci->SM_GetCount(m_szModuleName);
+ int count = g_chatApi.SM_GetCount(m_szModuleName);
for (int i = 0; i < count; i++) {
GC_INFO gci = { 0 };
gci.Flags = GCF_BYINDEX | GCF_DATA | GCF_NAME | GCF_TYPE;
diff --git a/protocols/IRCG/src/main.cpp b/protocols/IRCG/src/main.cpp
index d2b9722c68..086cb11dd3 100644
--- a/protocols/IRCG/src/main.cpp
+++ b/protocols/IRCG/src/main.cpp
@@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "version.h"
CMPlugin g_plugin;
-CHAT_MANAGER *pci;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -67,8 +66,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
extern "C" int __declspec(dllexport) Load()
{
- pci = Chat_GetInterface();
-
InitIcons();
InitServers();
InitContactMenus();
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp
index 8de2060953..3926b6aefc 100644
--- a/protocols/IRCG/src/scripting.cpp
+++ b/protocols/IRCG/src/scripting.cpp
@@ -162,7 +162,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam)
}
else if (sRequest == "channellist") {
CMStringW S = L"";
- int n = pci->SM_GetCount(m_szModuleName);
+ int n = g_chatApi.SM_GetCount(m_szModuleName);
if (n >= 0) {
int j = 0;
while (j < n) {
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index 369f2c5f76..556a479c96 100755
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -38,7 +38,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
HMODULE hMsftedit;
CMPlugin g_plugin;
-CHAT_MANAGER *pci;
int g_cbCountries;
CountryListEntry *g_countries;
@@ -151,9 +150,6 @@ static int OnModulesLoaded(WPARAM, LPARAM)
extern "C" int __declspec(dllexport) Load()
{
- // set the memory, lists & utf8 managers
- pci = Chat_GetInterface();
-
char mirVer[100];
Miranda_GetVersionText(mirVer, _countof(mirVer));
mir_wstrcpy(szCoreVersion, _A2T(mirVer));
diff --git a/protocols/SkypeWeb/src/main.cpp b/protocols/SkypeWeb/src/main.cpp
index 1f280d8763..cb8fe9e898 100644
--- a/protocols/SkypeWeb/src/main.cpp
+++ b/protocols/SkypeWeb/src/main.cpp
@@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
CMPlugin g_plugin;
-CHAT_MANAGER *pci;
char g_szMirVer[100];
HANDLE g_hCallEvent;
@@ -62,7 +61,6 @@ int CSkypeProto::OnModulesLoaded(WPARAM, LPARAM)
extern "C" int __declspec(dllexport) Load(void)
{
- pci = Chat_GetInterface();
Miranda_GetVersionText(g_szMirVer, sizeof(g_szMirVer));
CSkypeProto::InitIcons();
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp
index 1e0401e648..b19d812c29 100644
--- a/protocols/SkypeWeb/src/skype_chatrooms.cpp
+++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp
@@ -34,7 +34,7 @@ void CSkypeProto::InitGroupChatModule()
MCONTACT CSkypeProto::FindChatRoom(const char *chatname)
{
- SESSION_INFO *si = pci->SM_FindSession(_A2T(chatname), m_szModuleName);
+ SESSION_INFO *si = g_chatApi.SM_FindSession(_A2T(chatname), m_szModuleName);
return si ? si->hContact : 0;
}
diff --git a/protocols/Tox/src/main.cpp b/protocols/Tox/src/main.cpp
index a4d2df911a..329f6ffb51 100644
--- a/protocols/Tox/src/main.cpp
+++ b/protocols/Tox/src/main.cpp
@@ -1,7 +1,6 @@
#include "stdafx.h"
CMPlugin g_plugin;
-CHAT_MANAGER *pci;
HANDLE hProfileFolderPath;
@@ -49,10 +48,7 @@ int OnModulesLoaded(WPARAM, LPARAM)
extern "C" int __declspec(dllexport) Load(void)
{
- pci = Chat_GetInterface();
-
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
-
return 0;
}