summaryrefslogtreecommitdiff
path: root/utilities.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utilities.cpp')
-rw-r--r--utilities.cpp6
1 files changed, 4 insertions, 2 deletions
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;
}