From 34215e3c3e8eaa5e1c4e6107a185a1821b51c0ce Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 16 Jul 2010 16:05:11 +0300 Subject: modified: commonheaders.h modified: init.cpp modified: utilities.cpp --- commonheaders.h | 2 +- init.cpp | 2 ++ utilities.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/commonheaders.h b/commonheaders.h index 3214eb2..214b69a 100644 --- a/commonheaders.h +++ b/commonheaders.h @@ -23,8 +23,8 @@ #include using std::list; +#define MIRANDA_VER 0x0901 -#define MIRANDA_VER 0x0800 #include #include #include diff --git a/init.cpp b/init.cpp index e122349..99622ae 100644 --- a/init.cpp +++ b/init.cpp @@ -24,6 +24,7 @@ PLUGINLINK *pluginLink; static int OnModulesLoaded(WPARAM wParam,LPARAM lParam); extern char *date(); list Accounts; +XML_API xi; struct MM_INTERFACE mmi; struct UTF8_INTERFACE utfi; @@ -75,6 +76,7 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); mir_getMMI(&mmi); mir_getUTFI(&utfi); + mir_getXI(&xi); return 0; } diff --git a/utilities.cpp b/utilities.cpp index c21a919..87f4802 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -79,7 +79,7 @@ int HandleDbNewContact(WPARAM w, LPARAM l) { if(_tcsstr(_T(JUICK_JID), tmp)) { - if(!(*p)->hPrescenseHandler && !(*p)->hMessageHandler && !(*p)->hIqHandler) + if((*p)->hPrescenseHandler == INVALID_HANDLE_VALUE && (*p)->hMessageHandler == INVALID_HANDLE_VALUE && (*p)->hIqHandler == INVALID_HANDLE_VALUE) { IJabberNetInterface *ijnet = (*p)->JabberInterface->Net(); (*p)->hPrescenseHandler = ijnet->AddPresenceHandler((JABBER_HANDLER_FUNC)PrescenseHandler); @@ -104,7 +104,7 @@ int HandleDbContactDeleted(WPARAM w, LPARAM l) { if(_tcsstr(_T(JUICK_JID), tmp)) { - if((*p)->hPrescenseHandler && (*p)->hMessageHandler && (*p)->hIqHandler) + if((*p)->hPrescenseHandler != INVALID_HANDLE_VALUE && (*p)->hMessageHandler != INVALID_HANDLE_VALUE && (*p)->hIqHandler != INVALID_HANDLE_VALUE) { IJabberNetInterface *ijnet = (*p)->JabberInterface->Net(); ijnet->RemoveHandler((*p)->hPrescenseHandler); @@ -145,6 +145,8 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi static JABBER_HANDLER_FUNC MessageHandler(IJabberInterface *ji, HXML node, void *pUserData) { + if(!_tcsstr(xi.getAttr(node, 0), _T(JUICK_JID))) + return FALSE; return FALSE; } -- cgit v1.2.3