summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--commonheaders.h2
-rw-r--r--init.cpp2
-rw-r--r--utilities.cpp6
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 <list>
using std::list;
+#define MIRANDA_VER 0x0901
-#define MIRANDA_VER 0x0800
#include <newpluginapi.h>
#include <m_jabber.h>
#include <m_protocols.h>
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 <JabberAccount*> 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;
}