diff options
author | Vladimir <me@boku.ru> | 2018-01-31 17:01:42 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-31 22:09:55 +0300 |
commit | b8f8623145589530eae0bdb957e5337537797a92 (patch) | |
tree | e9c4054100cd577694805d3f9d63e8a8521bf9f6 /protocols/JabberG/src | |
parent | 73b0193a9d1792e8459b56415ab2fcfdeb6fb385 (diff) |
Added an option to enable/disable carbons
Diffstat (limited to 'protocols/JabberG/src')
-rwxr-xr-x | protocols/JabberG/src/jabber_db_utils.h | 2 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_iqid.cpp | 2 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_opt.cpp | 1 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_thread.cpp | 4 |
4 files changed, 8 insertions, 1 deletions
diff --git a/protocols/JabberG/src/jabber_db_utils.h b/protocols/JabberG/src/jabber_db_utils.h index 5af4099449..40654207ca 100755 --- a/protocols/JabberG/src/jabber_db_utils.h +++ b/protocols/JabberG/src/jabber_db_utils.h @@ -83,6 +83,7 @@ struct CJabberOptions CMOption<DWORD> ConnectionKeepAliveTimeout;
CMOption<BYTE> ProcessXMPPLinks;
CMOption<BYTE> IgnoreRosterGroups;
+ CMOption<BYTE> EnableCarbons;
CMOption<BYTE> UseOMEMO;
@@ -141,6 +142,7 @@ struct CJabberOptions ConnectionKeepAliveTimeout(proto, "ConnectionKeepAliveTimeout", 50000),
ProcessXMPPLinks(proto, "ProcessXMPPLinks", FALSE),
IgnoreRosterGroups(proto, "IgnoreRosterGroups", FALSE),
+ EnableCarbons(proto, "EnableCarbons", TRUE),
UseOMEMO(proto, "UseOMEMO", FALSE)
{}
};
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 4ecac9d48e..3780c794bd 100755 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -136,7 +136,7 @@ void CJabberProto::OnProcessLoginRq(ThreadData *info, DWORD rq) EnableArchive(m_options.EnableMsgArchive != 0);
if (info->jabberServerCaps & JABBER_CAPS_CARBONS)
- EnableCarbons(true);
+ EnableCarbons(m_options.EnableCarbons != 0);
if (m_options.AutoJoinBookmarks) {
LIST<JABBER_LIST_ITEM> ll(10);
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 5b751fc96f..c09f62e55f 100755 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -794,6 +794,7 @@ public: m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Receive notes"), m_proto->m_options.AcceptNotes);
m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Automatically save received notes"), m_proto->m_options.AutosaveNotes);
m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Enable server-side history"), m_proto->m_options.EnableMsgArchive);
+ m_otvOptions.AddOption(LPGENW("Messaging") L"/" LPGENW("Receive conversations from other devices (carbons)"), m_proto->m_options.EnableCarbons);
m_otvOptions.AddOption(LPGENW("Server options") L"/" LPGENW("Disable SASL authentication (for old servers)"), m_proto->m_options.Disable3920auth);
m_otvOptions.AddOption(LPGENW("Server options") L"/" LPGENW("Enable stream compression (if possible)"), m_proto->m_options.EnableZlib);
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 1177020ab0..4801e50179 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1062,6 +1062,10 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) carbonSent = true;
}
if (carbon) {
+ //If carbons are disabled in options, we should ignore occasional carbons sent to us by server
+ if (!m_options.EnableCarbons)
+ return;
+
HXML forwarded = NULL;
HXML message = NULL;
//Carbons MUST have forwarded/message content
|