summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_iqid.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-12-23 18:52:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-12-23 18:52:25 +0000
commit4b283b1cf3004aebbb1f4807456a2cd0fdb5f30c (patch)
tree00ee44be29c5ac306109eb2cd9d1fc7047644b3f /protocols/JabberG/src/jabber_iqid.cpp
parentaf8c5b336e9609ed9c53b877dd7f57fb3d7194b9 (diff)
- XEP-0136 support (server-side message history);
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@2816 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_iqid.cpp')
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 664167b73f..74f8333634 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -67,16 +67,21 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode)
<< XQUERY(_T(JABBER_FEAT_GTALK_SHARED_STATUS)) << XATTR(_T("version"), _T("2")));
}
}
+
if (m_ThreadInfo) {
HXML feature;
for (i = 1; (feature = xmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
const TCHAR *featureName = xmlGetAttrValue(feature, _T("var"));
- if (featureName) {
- for (int j = 0; g_JabberFeatCapPairs[j].szFeature; j++) {
- if ( !_tcscmp(g_JabberFeatCapPairs[j].szFeature, featureName)) {
- m_ThreadInfo->jabberServerCaps |= g_JabberFeatCapPairs[j].jcbCap;
- break;
- } } } } }
+ if (!featureName)
+ continue;
+
+ for (int j = 0; g_JabberFeatCapPairs[j].szFeature; j++)
+ if ( !_tcscmp(g_JabberFeatCapPairs[j].szFeature, featureName)) {
+ m_ThreadInfo->jabberServerCaps |= g_JabberFeatCapPairs[j].jcbCap;
+ break;
+ }
+ }
+ }
OnProcessLoginRq(m_ThreadInfo, JABBER_LOGIN_SERVERINFO);
} }
@@ -126,9 +131,11 @@ void CJabberProto::OnProcessLoginRq(ThreadData* info, DWORD rq)
info->dwLoginRqs |= rq;
- if ((info->dwLoginRqs & JABBER_LOGIN_ROSTER) && (info->dwLoginRqs & JABBER_LOGIN_BOOKMARKS) &&
- (info->dwLoginRqs & JABBER_LOGIN_SERVERINFO) && !(info->dwLoginRqs & JABBER_LOGIN_BOOKMARKS_AJ))
- {
+ DWORD dwMask = JABBER_LOGIN_ROSTER | JABBER_LOGIN_BOOKMARKS | JABBER_LOGIN_SERVERINFO;
+ if ((info->dwLoginRqs & dwMask) == dwMask && !(info->dwLoginRqs & JABBER_LOGIN_BOOKMARKS_AJ)) {
+ if (info->jabberServerCaps & JABBER_CAPS_ARCHIVE_AUTO)
+ EnableArchive(m_options.EnableMsgArchive != 0);
+
if (jabberChatDllPresent && m_options.AutoJoinBookmarks) {
LIST<JABBER_LIST_ITEM> ll(10);
LISTFOREACH(i, this, LIST_BOOKMARK)
@@ -153,7 +160,8 @@ void CJabberProto::OnProcessLoginRq(ThreadData* info, DWORD rq)
TCHAR* nick = JabberNickFromJID(m_szJabberJID);
GroupchatJoinRoom(server, p, nick, item->password, true);
mir_free(nick);
- } }
+ }
+ }
ll.destroy();
}
@@ -196,7 +204,7 @@ void CJabberProto::OnLoggedIn()
m_ThreadInfo->jabberServerCaps = JABBER_RESOURCE_CAPS_NONE;
iqId = SerialNext();
IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultServerDiscoInfo);
- m_ThreadInfo->send(XmlNodeIq(_T("get"), iqId, _A2T(m_ThreadInfo->server)) << XQUERY(_T(JABBER_FEAT_DISCO_INFO)));
+ m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId, _A2T(m_ThreadInfo->server)) << XQUERY(_T(JABBER_FEAT_DISCO_INFO)));
QueryPrivacyLists(m_ThreadInfo);