diff options
-rw-r--r-- | protocols/GTalkExt/src/handlers.cpp | 27 |
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) {
|