summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-21 23:24:02 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-21 23:24:02 +0000
commitef0abe4f9f67eeff4007f4839ba08a503472c74c (patch)
tree6b3e4e878aabab3c1b0995d62fab9257772cd39e /protocols/JabberG
parentc5427646b03c73c179a31505671a9ad785709eb3 (diff)
- new typed helper, WindowList_Create, to create a window list
- new service, WindowList_Destroy, to destroy a window list - internal windowlist.cpp implementation rewritten to LIST<> git-svn-id: http://svn.miranda-ng.org/main/trunk@7823 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/src/jabber.cpp3
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp7
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp4
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp7
4 files changed, 16 insertions, 5 deletions
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index c8f45d0f2b..663f68d4c4 100644
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -65,6 +65,7 @@ HANDLE hExtraMood = NULL;
HANDLE hExtListInit, hDiscoInfoResult;
void JabberUserInfoInit(void);
+void JabberUserInfoUninit(void);
int bSecureIM, bMirOTR, bNewGPG, bPlatform;
@@ -227,6 +228,8 @@ extern "C" int __declspec(dllexport) Load()
extern "C" int __declspec(dllexport) Unload(void)
{
+ JabberUserInfoUninit();
+
DestroyHookableEvent(hExtListInit);
DestroyHookableEvent(hDiscoInfoResult);
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 04a1b8c3be..2d0f0beb0b 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -33,6 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MENUITEM_SERVER 2
#define MENUITEM_RESOURCES 10
+static HANDLE hDialogsList = NULL;
static HANDLE hChooserMenu, hStatusMenuInit;
static int iChooserMenuPos = 30000;
@@ -337,6 +338,8 @@ void g_MenuUninit(void)
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)g_hMenuLogin, 0);
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)g_hMenuRefresh, 0);
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)g_hMenuAddBookmark, 0);
+
+ WindowList_Destroy(hDialogsList);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -966,8 +969,6 @@ void CJabberProto::CheckMenuItems()
//////////////////////////////////////////////////////////////////////////
// resource menu
-static HANDLE hDialogsList = NULL;
-
void CJabberProto::MenuUpdateSrmmIcon(JABBER_LIST_ITEM *item)
{
if (item->list != LIST_ROSTER)
@@ -989,7 +990,7 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam)
if (event->uType == MSG_WINDOW_EVT_OPEN) {
if (!hDialogsList)
- hDialogsList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hDialogsList = WindowList_Create();
WindowList_Add(hDialogsList, event->hwndWindow, event->hContact);
ptrT jid(getTStringA(event->hContact, "jid"));
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index bd0800245d..836b016cdd 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -79,7 +79,7 @@ CJabberProto::CJabberProto(const char *aProtoName, const TCHAR *aUserName) :
debugLogA("Setting protocol/module name to '%s'", m_szModuleName);
// Jabber dialog list
- m_windowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ m_windowList = WindowList_Create();
// Protocol services and events...
m_hEventNudge = CreateProtoEvent(PE_NUDGE);
@@ -170,6 +170,8 @@ CJabberProto::~CJabberProto()
delete m_pInfoFrame;
+ WindowList_Destroy(m_windowList);
+
DestroyHookableEvent(m_hEventNudge);
DestroyHookableEvent(m_hEventXStatusIconChanged);
DestroyHookableEvent(m_hEventXStatusChanged);
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index 77262da4f2..bb85ac1f74 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -833,7 +833,12 @@ int CJabberProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam)
void JabberUserInfoInit()
{
- hUserInfoList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hUserInfoList = WindowList_Create();
+}
+
+void JabberUserInfoUninit()
+{
+ WindowList_Destroy(hUserInfoList);
}
/////////////////////////////////////////////////////////////////////////////////////////