summaryrefslogtreecommitdiff
path: root/protocols/GTalkExt/src/handlers.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-02 20:38:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-02 20:38:14 +0000
commit8429123c9608a5266b4dde1694b8ef71576e05ac (patch)
treee674213b6d30fe3828d9a2fc742c1efd509643a5 /protocols/GTalkExt/src/handlers.cpp
parent681126055acd747349453a57bbed6624420e0c6e (diff)
duplicate packet removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@6315 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/GTalkExt/src/handlers.cpp')
-rw-r--r--protocols/GTalkExt/src/handlers.cpp27
1 files changed, 3 insertions, 24 deletions
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp
index f8e237345e..fcc08177fc 100644
--- a/protocols/GTalkExt/src/handlers.cpp
+++ b/protocols/GTalkExt/src/handlers.cpp
@@ -285,8 +285,6 @@ BOOL DiscoverHandler(IJabberInterface *ji, HXML node, void *pUserData)
return FALSE;
}
-extern DWORD itlsRecursion;
-
BOOL SendHandler(IJabberInterface *ji, HXML node, void *pUserData)
{
GoogleTalkAcc *gta = isGoogle(LPARAM(ji));
@@ -295,28 +293,9 @@ BOOL SendHandler(IJabberInterface *ji, HXML node, void *pUserData)
HXML queryNode = xi.getChildByAttrValue(node, NODENAME_QUERY, ATTRNAME_XMLNS, DISCOVERY_XMLNS);
if (queryNode) {
- if ( lstrcmp(xi.getName(node), NODENAME_IQ) || lstrcmp(xi.getAttrValue(node, ATTRNAME_TYPE), IQTYPE_GET))
- return FALSE;
- if (TlsGetValue(itlsRecursion))
- return FALSE;
-
- TlsSetValue(itlsRecursion, (PVOID)TRUE);
-
- UINT id = ji->SerialNext();
- HXML newNode = xi.createNode(NODENAME_IQ, NULL, FALSE);
- xi.addAttr(newNode, ATTRNAME_TYPE, IQTYPE_GET);
- xi.addAttr(newNode, ATTRNAME_TO, xi.getAttrValue(node, ATTRNAME_TO));
-
- TCHAR idAttr[30];
- mir_sntprintf(idAttr, SIZEOF(idAttr), JABBER_IQID_FORMAT, id);
- xi.addAttr(newNode, ATTRNAME_ID, idAttr);
-
- xi.addAttr(xi.addChild(newNode, NODENAME_QUERY, NULL), ATTRNAME_XMLNS, DISCOVERY_XMLNS);
- ji->SendXmlNode(newNode);
- xi.destroyNode(newNode);
-
- ji->AddTemporaryIqHandler(DiscoverHandler, JABBER_IQ_TYPE_RESULT, id, NULL, RESPONSE_TIMEOUT);
- TlsSetValue(itlsRecursion, (PVOID)FALSE);
+ LPCTSTR ptszId = xi.getAttrValue(node, ATTRNAME_ID);
+ if (ptszId)
+ ji->AddTemporaryIqHandler(DiscoverHandler, JABBER_IQ_TYPE_RESULT, _ttoi(ptszId+4), NULL, RESPONSE_TIMEOUT, 500);
}
if ( !lstrcmp(xi.getName(node), _T("presence")) && xi.getAttrValue(node, ATTRNAME_TO) == 0) {