summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp2
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp3
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp1
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp1
-rw-r--r--protocols/JabberG/src/jabber_proto.h1
-rw-r--r--protocols/JabberG/src/jabber_util.cpp2
6 files changed, 9 insertions, 1 deletions
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index dea74127ce..5a71713436 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -342,6 +342,8 @@ JabberCapsBits CJabberProto::GetOwnCaps(bool IncludeDynamic)
for (auto &it : m_lstJabberFeatCapPairsDynamic)
jcb |= it->jcbCap;
+ if (!m_bAllowLast)
+ jcb &= ~JABBER_CAPS_LAST_ACTIVITY;
if (!m_bAllowTimeReplies)
jcb &= ~JABBER_CAPS_ENTITY_TIME;
if (!m_bAllowVersionRequests)
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 2b21589caa..4c2264fe56 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -63,6 +63,9 @@ bool CJabberProto::OnIqRequestVersion(const TiXmlElement*, CJabberIqInfo *pInfo)
// last activity (XEP-0012) support
bool CJabberProto::OnIqRequestLastActivity(const TiXmlElement*, CJabberIqInfo *pInfo)
{
+ if (!m_bAllowLast)
+ return false;
+
m_ThreadInfo->send(
XmlNodeIq("result", pInfo) << XQUERY(JABBER_FEAT_LAST_ACTIVITY)
<< XATTRI("seconds", m_tmJabberIdleStartTime ? time(0) - m_tmJabberIdleStartTime : 0));
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index 4dc0764e9d..7595738e36 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -726,6 +726,7 @@ public:
m_options.AddOption(LPGENW("Security"), LPGENW("Allow local time and timezone requests (XEP-0202)"), proto->m_bAllowTimeReplies);
m_options.AddOption(LPGENW("Security"), LPGENW("Allow servers to request version (XEP-0092)"), proto->m_bAllowVersionRequests);
m_options.AddOption(LPGENW("Security"), LPGENW("Show information about operating system in version replies"), proto->m_bShowOSVersion);
+ m_options.AddOption(LPGENW("Security"), LPGENW("Allow last activity replies (XEP-0319 & XEP-0012)"), proto->m_bAllowLast);
m_options.AddOption(LPGENW("Security"), LPGENW("Accept HTTP Authentication requests (XEP-0070)"), proto->m_bAcceptHttpAuth);
m_options.AddOption(LPGENW("Security"), LPGENW("Use OMEMO encryption for messages if possible (XEP-0384) (basic support without GUI)"), proto->m_bUseOMEMO);
}
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 8b6363b67a..e43d1b2ee3 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -80,6 +80,7 @@ CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) :
m_bAcceptNotes(this, "AcceptNotes", true),
m_bAllowTimeReplies(this, "AllowTimeReplies", true),
m_bAllowVersionRequests(this, "AllowVersionRequests", true),
+ m_bAllowLast(this, "AllowLast", false),
m_bAutoAcceptAuthorization(this, "AutoAcceptAuthorization", false),
m_bAutoAcceptMUC(this, "AutoAcceptMUC", false),
m_bAutoAdd(this, "AutoAdd", true),
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 73f7b187a8..dcd6f753f2 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -185,6 +185,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
CMOption<bool> m_bAcceptNotes;
CMOption<bool> m_bAllowTimeReplies;
CMOption<bool> m_bAllowVersionRequests;
+ CMOption<bool> m_bAllowLast;
CMOption<bool> m_bAutoAcceptAuthorization;
CMOption<bool> m_bAutoAcceptMUC;
CMOption<bool> m_bAutoAdd;
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index fb1af37244..5d63b0d5a0 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -510,7 +510,7 @@ void CJabberProto::SendPresenceTo(int status, const char *to, const TiXmlElement
}
}
- if (m_tmJabberIdleStartTime) {
+ if (m_bAllowLast && m_tmJabberIdleStartTime) {
// XEP-0319 support
char szSince[100];
time2str(m_tmJabberIdleStartTime, szSince, _countof(szSince));