From 07768cb3b3d3876e67863428118c9e9e2b6c4b18 Mon Sep 17 00:00:00 2001 From: dartraiden Date: Wed, 24 Jun 2020 16:13:55 +0300 Subject: Revert "Jabber: user name to be encoded to avoid spaces" This reverts commit 2c369e66feacfb3b934b1ec28fcecd179d796ba1. --- protocols/JabberG/src/jabber_iqid.cpp | 2 +- protocols/JabberG/src/jabber_menu.cpp | 7 +++++++ protocols/JabberG/src/jabber_thread.cpp | 2 +- protocols/JabberG/src/jabber_util.cpp | 7 ------- protocols/JabberG/src/stdafx.h | 1 - 5 files changed, 9 insertions(+), 10 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 5f8736b31e..690e936ad8 100755 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -239,7 +239,7 @@ void CJabberProto::OnIqResultGetAuth(const TiXmlElement *iqNode, CJabberIqInfo*) if (!mir_strcmp(type, "result")) { XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResultSetAuth, JABBER_IQ_TYPE_SET)); auto *query = iq << XQUERY("jabber:iq:auth"); - query << XCHILD("username", EncodeJid(m_ThreadInfo->conn.username)); + query << XCHILD("username", m_ThreadInfo->conn.username); if (XmlFirstChild(queryNode, "digest") != nullptr && m_ThreadInfo->szStreamId) { JabberShaStrBuf buf; char text[200]; diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index ee67312f4a..92acc5ca6d 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -799,6 +799,13 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam) if (!hDialogsList) hDialogsList = WindowList_Create(); WindowList_Add(hDialogsList, event->hwndWindow, event->hContact); + + ptrA jid(getUStringA(event->hContact, "jid")); + if (jid != nullptr) { + JABBER_LIST_ITEM *pItem = ListGetItemPtr(LIST_ROSTER, jid); + // if (pItem) + // RetrieveMessageArchive(event->hContact, pItem); + } } else if (event->uType == MSG_WINDOW_EVT_CLOSING) { if (hDialogsList) diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 1a631ad89a..e911d7f33d 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -561,7 +561,7 @@ void CJabberProto::PerformIqAuth(ThreadData *info) { if (!info->bIsReg) { info->send(XmlNodeIq(AddIQ(&CJabberProto::OnIqResultGetAuth, JABBER_IQ_TYPE_GET)) - << XQUERY("jabber:iq:auth") << XCHILD("username", EncodeJid(info->conn.username))); + << XQUERY("jabber:iq:auth") << XCHILD("username", info->conn.username)); } else PerformRegistration(info); } diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index a23247b435..aa64fb68e7 100755 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -76,13 +76,6 @@ CMStringA MakeJid(const char *jid, const char *resource) return ret; } -CMStringA EncodeJid(const char *jid) -{ - CMStringA ret(jid); - ret.Replace(" ", "\20"); - return ret; -} - void CJabberProto::UpdateItem(JABBER_LIST_ITEM *pItem, const char *name) { if (!m_bIgnoreRoster || db_get_wsm(pItem->hContact, "CList", "MyHandle").IsEmpty()) { diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index a6f1d58f99..e744ff7075 100755 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -740,7 +740,6 @@ struct TStringPairs typedef char JabberShaStrBuf[2*MIR_SHA1_HASH_SIZE + 1]; -CMStringA EncodeJid(const char *jid); CMStringA MakeJid(const char *jid, const char *resource); char* JabberNickFromJID(const char *jid); -- cgit v1.2.3