summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_thread.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2018-03-28 10:03:13 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2018-03-28 10:03:13 +0300
commit37a61502be9d19eb89efd2c8c0cbe0debe968333 (patch)
tree6e5f26386831d6f45f99ae35ded6e2b7a39d21e5 /protocols/JabberG/src/jabber_thread.cpp
parent5e65ecbf7c7e008ac23adc0f29bc000f7fd27019 (diff)
prootcols: jabber: xep-0198
- send ack on disconnect as suggested by xep - bugfixes (outgoing messages tracking still does not work properly)
Diffstat (limited to 'protocols/JabberG/src/jabber_thread.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index aee0373064..d79a2d72e0 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -128,6 +128,8 @@ void CJabberProto::OnPingReply(HXML, CJabberIqInfo *pInfo)
return;
if (pInfo->GetIqType() == JABBER_IQ_TYPE_FAIL) {
// disconnect because of timeout
+ if (m_bEnableStreamMgmt)
+ m_StrmMgmt.SendAck();
m_ThreadInfo->send("</stream:stream>");
m_ThreadInfo->shutdown();
}
@@ -820,6 +822,8 @@ void CJabberProto::OnProcessError(HXML node, ThreadData *info)
if (!skipMsg)
MsgPopup(0, buff, TranslateT("Jabber Error"));
+ if (m_bEnableStreamMgmt) //TODO: check if needed/work here
+ m_StrmMgmt.SendAck();
info->send("</stream:stream>");
}
@@ -2113,6 +2117,18 @@ int ThreadData::send(HXML node)
while (HXML parent = xmlGetParent(node))
node = parent;
+ int result = send_no_strm_mgmt(node);
+
+ if (proto->m_bEnableStreamMgmt)
+ proto->m_StrmMgmt.HandleOutgoingNode(node); //TODO: is this a correct place ?, looks like some nodes does not goes here...
+
+ return result;
+}
+
+// this function required for send <r/>, <a/> and more important, for resend stuck nodes by strm_mgmt (xep-0198)
+int ThreadData::send_no_strm_mgmt(HXML node)
+{
+
if (proto->m_sendManager.HandleSendPermanent(node, this))
return 0;
@@ -2132,12 +2148,10 @@ int ThreadData::send(HXML node)
}
*q = 0;
-
T2Utf utfStr(str);
int result = send(utfStr, (int)mir_strlen(utfStr));
-
xmlFree(str);
- if (proto->m_bEnableStreamMgmt)
- proto->m_StrmMgmt.HandleOutgoingNode(node); //TODO: is this a correct place ?
+
return result;
-}
+
+} \ No newline at end of file