From 352fe9cb793622c4a6ccc88e938ae51ed09b6d94 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 22 Aug 2016 19:13:27 +0000 Subject: fix for registration using dynamic form git-svn-id: http://svn.miranda-ng.org/main/trunk@17199 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_thread.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index fa9f273a39..f869c96f1c 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1855,15 +1855,18 @@ void CJabberProto::OnProcessIq(HXML node) ThreadData *m_regInfo; void CJabberProto::SetRegConfig(HXML node, void *from) { - if (m_regInfo && from) { + if (m_regInfo) { + iqIdRegSetReg = SerialNext(); + wchar_t text[MAX_PATH]; mir_snwprintf(text, L"%s@%S", m_regInfo->conn.username, m_regInfo->conn.server); - XmlNodeIq iq(L"set", SerialNext(), (wchar_t*)from); + XmlNodeIq iq(L"set", iqIdRegSetReg, (const wchar_t*)from); iq << XATTR(L"from", text); HXML query = iq << XQUERY(JABBER_FEAT_REGISTER); XmlAddChild(query, node); m_regInfo->send(iq); } + mir_free(from); } void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info) @@ -1882,13 +1885,9 @@ void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info) if (!mir_wstrcmp(str, JABBER_FEAT_REGISTER)) { HXML xNode = XmlGetChild(queryNode, L"x"); if (xNode != NULL) { - str = XmlGetAttrValue(xNode, L"xmlns"); - if (!mir_wstrcmp(str, JABBER_FEAT_DATA_FORMS)) { - LPCTSTR from = XmlGetAttrValue(node, L"from"); - if (from != NULL) { - m_regInfo = info; - FormCreateDialog(xNode, L"Jabber register new user", &CJabberProto::SetRegConfig, mir_wstrdup(from)); - } + if (!mir_wstrcmp(XmlGetAttrValue(xNode, L"xmlns"), JABBER_FEAT_DATA_FORMS)) { + m_regInfo = info; + FormCreateDialog(xNode, L"Jabber register new user", &CJabberProto::SetRegConfig, mir_wstrdup(XmlGetAttrValue(node, L"from"))); return; } } -- cgit v1.2.3