summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-23 23:29:25 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-23 23:29:25 +0300
commit176e52e14fd0358a7f26ca8d7b0205244dfde2e7 (patch)
tree10da2f8951d20103af0215c38d07ea96ba61c191 /protocols/JabberG
parent91b13500b47a51f3a284d9f409b7b8dac167a06d (diff)
no need to initialize pcli variable in each plugin (only in Clist_*)
Diffstat (limited to 'protocols/JabberG')
-rwxr-xr-xprotocols/JabberG/src/jabber.cpp3
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp12
-rw-r--r--protocols/JabberG/src/jabber_frame.cpp4
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp2
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp2
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp2
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp2
8 files changed, 13 insertions, 16 deletions
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index 21900ab114..369f2c5f76 100755
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -46,8 +46,6 @@ CountryListEntry *g_countries;
unsigned int g_nTempFileId;
wchar_t szCoreVersion[100];
-CLIST_INTERFACE* pcli;
-
HANDLE hExtraActivity = nullptr;
HANDLE hExtraMood = nullptr;
HANDLE hExtListInit, hDiscoInfoResult;
@@ -155,7 +153,6 @@ extern "C" int __declspec(dllexport) Load()
{
// set the memory, lists & utf8 managers
pci = Chat_GetInterface();
- pcli = Clist_GetInterface();
char mirVer[100];
Miranda_GetVersionText(mirVer, _countof(mirVer));
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index df81e4cd9f..63f729f9b5 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -1172,17 +1172,17 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
break;
case IDM_CPY_NICK:
- JabberCopyText(pcli->hwndContactList, him->m_tszResourceName);
+ JabberCopyText(g_CLI.hwndContactList, him->m_tszResourceName);
break;
case IDM_RJID_COPY:
case IDM_CPY_RJID:
- JabberCopyText(pcli->hwndContactList, him->m_tszRealJid);
+ JabberCopyText(g_CLI.hwndContactList, him->m_tszRealJid);
break;
case IDM_CPY_INROOMJID:
szBuffer.Format(L"%s/%s", item->jid, him->m_tszResourceName);
- JabberCopyText(pcli->hwndContactList, szBuffer);
+ JabberCopyText(g_CLI.hwndContactList, szBuffer);
break;
case IDM_RJID_VCARD:
@@ -1208,7 +1208,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
if (wchar_t *tmp = wcschr(psr.id.w, '/'))
*tmp = 0;
psr.nick.w = psr.id.w;
- Contact_AddBySearch(ppro->m_szModuleName, &psr, pcli->hwndContactList);
+ Contact_AddBySearch(ppro->m_szModuleName, &psr, g_CLI.hwndContactList);
}
break;
}
@@ -1329,11 +1329,11 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g
break;
case IDM_CPY_RJID:
- JabberCopyText(pcli->hwndContactList, item->jid);
+ JabberCopyText(g_CLI.hwndContactList, item->jid);
break;
case IDM_CPY_TOPIC:
- JabberCopyText(pcli->hwndContactList, item->getTemp()->m_tszStatusMessage);
+ JabberCopyText(g_CLI.hwndContactList, item->getTemp()->m_tszStatusMessage);
break;
}
}
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp
index aff1bd2720..7a0e1a947b 100644
--- a/protocols/JabberG/src/jabber_frame.cpp
+++ b/protocols/JabberG/src/jabber_frame.cpp
@@ -78,7 +78,7 @@ CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto):
InitClass();
CLISTFrame frame = { sizeof(frame) };
- HWND hwndClist = pcli->hwndContactList;
+ HWND hwndClist = g_CLI.hwndContactList;
frame.hWnd = CreateWindowEx(0, L"JabberInfoFrameClass", nullptr, WS_CHILD|WS_VISIBLE, 0, 0, 100, 100, hwndClist, nullptr, g_plugin.getInst(), this);
frame.align = alBottom;
frame.height = 2 * SZ_FRAMEPADDING + GetSystemMetrics(SM_CYSMICON) + SZ_LINEPADDING; // compact height by default
@@ -182,7 +182,7 @@ LRESULT CJabberInfoFrame::WndProc(UINT msg, WPARAM wParam, LPARAM lParam)
POINT pt = { LOWORD(lParam), HIWORD(lParam) };
MapWindowPoints(m_hwnd, nullptr, &pt, 1);
HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDFRAMECONTEXT, m_frameId, 0);
- int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
Clist_MenuProcessCommand(res, 0, m_frameId);
return 0;
}
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 942e257746..f7dd1d1764 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -452,7 +452,7 @@ BOOL CJabberProto::AddClistHttpAuthEvent(CJabberHttpAuthParams *pParams)
cle.lParam = (LPARAM)pParams;
cle.pszService = szService;
cle.szTooltip.w = TranslateT("Http authentication request received");
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 308c215d20..439d091e0d 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -1081,7 +1081,7 @@ CJabberProto* JabberChooseInstance(bool bIsLink)
HMENU hMenu = CreatePopupMenu();
Menu_Build(hMenu, hChooserMenu);
- int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
DestroyMenu(hMenu);
if (res) {
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index 07784b7ad7..b787622f2a 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -785,7 +785,7 @@ bool CJabberProto::OnIncomingNote(const wchar_t *szFrom, HXML hXml)
cle.lParam = (LPARAM)pItem;
cle.pszService = szService;
cle.szTooltip.w = TranslateT("Incoming note");
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
return true;
}
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 80dcec55f5..11a6144b76 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -1316,7 +1316,7 @@ void CJabberProto::InfoFrame_OnTransport(CJabberInfoFrame_Event *evt)
HMENU hContactMenu = Menu_BuildContactMenu(hContact);
POINT pt;
GetCursorPos(&pt);
- int res = TrackPopupMenu(hContactMenu, TPM_RETURNCMD, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ int res = TrackPopupMenu(hContactMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
Clist_MenuProcessCommand(res, MPCF_CONTACTMENU, hContact);
}
}
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 6bdefc5412..2fe625e4f8 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -603,7 +603,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
db_event_markRead(hContact, hDbEvent);
if (bRemoveCListEvents)
- pcli->pfnRemoveEvent(hContact, hDbEvent);
+ g_CLI.pfnRemoveEvent(hContact, hDbEvent);
}
}