summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_byte.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-04-13 17:54:12 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-04-13 17:54:12 +0300
commitccd1d2cf194034faa91ee353e544a9337d3fa993 (patch)
tree8721417a5d7217a0b71200a5f142507c5b3f0983 /protocols/JabberG/src/jabber_byte.cpp
parentfee3a74e7429552ebbfe7ae9c14a4f6c25156fb6 (diff)
Jabber:
- Miranda to generate globally unique packet ids; - unused member IJabberInterface::AddTemporaryIqHandler removed; - two rarely used params removed from CJabberProto::AddIQ && CJabberIqManager::AddHandler - code cleaning
Diffstat (limited to 'protocols/JabberG/src/jabber_byte.cpp')
-rw-r--r--protocols/JabberG/src/jabber_byte.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp
index 5d89502c94..c72ebaaea6 100644
--- a/protocols/JabberG/src/jabber_byte.cpp
+++ b/protocols/JabberG/src/jabber_byte.cpp
@@ -161,7 +161,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt)
jbt->szProxyJid = nullptr;
jbt->hProxyEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
- CJabberIqInfo *pInfo = AddIQ(&CJabberProto::IqResultProxyDiscovery, JABBER_IQ_TYPE_GET, proxyJid, 0, -1, jbt);
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::IqResultProxyDiscovery, JABBER_IQ_TYPE_GET, proxyJid, jbt);
nIqId = pInfo->GetIqId();
XmlNodeIq iq(pInfo);
iq << XQUERY(JABBER_FEAT_BYTESTREAMS);
@@ -184,7 +184,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt)
}
}
- CJabberIqInfo *pInfo = AddIQ(&CJabberProto::ByteInitiateResult, JABBER_IQ_TYPE_SET, jbt->dstJID, 0, -1, jbt);
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::ByteInitiateResult, JABBER_IQ_TYPE_SET, jbt->dstJID, jbt);
nIqId = pInfo->GetIqId();
char szPort[8];
{
@@ -538,18 +538,15 @@ int CJabberProto::ByteSendProxyParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jb
jbt->hProxyEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
jbt->bStreamActivated = FALSE;
- int iqId = SerialNext();
+ auto *pIq = AddIQ(&CJabberProto::IqResultStreamActivate, JABBER_IQ_TYPE_SET, jbt->streamhostJID);
char listJid[256];
- mir_snprintf(listJid, "ftproxy_%d", iqId);
+ mir_snprintf(listJid, "ftproxy_%d", pIq->GetIqId());
JABBER_LIST_ITEM *item = ListAdd(LIST_FTIQID, listJid);
item->jbt = jbt;
- m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::IqResultStreamActivate, JABBER_IQ_TYPE_SET, jbt->streamhostJID, 0, iqId))
- << XQUERY(JABBER_FEAT_BYTESTREAMS) << XATTR("sid", jbt->sid) << XCHILD("activate", jbt->dstJID));
-
+ m_ThreadInfo->send(XmlNodeIq(pIq) << XQUERY(JABBER_FEAT_BYTESTREAMS) << XATTR("sid", jbt->sid) << XCHILD("activate", jbt->dstJID));
WaitForSingleObject(jbt->hProxyEvent, INFINITE);
CloseHandle(jbt->hProxyEvent);