summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-08-22 19:13:27 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-08-22 19:13:27 +0000
commit352fe9cb793622c4a6ccc88e938ae51ed09b6d94 (patch)
tree7ba316f439cacbde1cf6cdace8f92abe0bf193a7 /protocols
parentf9d6a69003715ece61edf4e890e0c7eb8671b6d6 (diff)
fix for registration using dynamic form
git-svn-id: http://svn.miranda-ng.org/main/trunk@17199 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp17
1 files 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;
}
}