summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_caps.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG/src/jabber_caps.cpp')
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index 852ba4e935..77a7ed9ac9 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -112,18 +112,9 @@ void CJabberProto::OnIqResultCapsDiscoInfo(const TiXmlElement*, CJabberIqInfo *p
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && query) {
JabberCapsBits jcbCaps = 0;
- for (auto *feature : TiXmlFilter(query, "feature")) {
- const char *featureName = XmlGetAttr(feature, "var");
- if (!featureName)
- continue;
-
- for (auto &it : g_JabberFeatCapPairs) {
- if (!mir_strcmp(it.szFeature, featureName)) {
- jcbCaps |= it.jcbCap;
- break;
- }
- }
- }
+ for (auto *feature : TiXmlFilter(query, "feature"))
+ if (auto *featureName = XmlGetAttr(feature, "var"))
+ jcbCaps += GetFeatureCaps(featureName);
// no XEP-0115 support? store info & exit
CJabberClientPartialCaps *pCaps = r->m_pCaps;
@@ -329,6 +320,19 @@ bool CJabberProto::HandleCapsInfoRequest(const TiXmlElement *, CJabberIqInfo *pI
return true;
}
+JabberCapsBits CJabberProto::GetFeatureCaps(const char *pszFeature)
+{
+ for (auto &it : g_JabberFeatCapPairs)
+ if (!mir_strcmp(it.szFeature, pszFeature))
+ return it.jcbCap;
+
+ for (auto &it : m_lstJabberFeatCapPairsDynamic)
+ if (!mir_strcmp(it->szFeature, pszFeature))
+ return it->jcbCap;
+
+ return 0;
+}
+
JabberCapsBits CJabberProto::GetOwnCaps(bool IncludeDynamic)
{
JabberCapsBits jcb = JABBER_CAPS_MIRANDA_ALL;