Skip to content

Commit b163d05

Browse files
Malcolmjcbrand
Malcolm
authored andcommitted
ADD Omemo default support (#1476)
1 parent a16c068 commit b163d05

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
- #1445: Participants list uses big font in embedded mode
3939
- #1455: Avatar in controlbox status-view not updated
4040
- #1465: When highlighting a roster contact, they're incorrectly shown as online
41+
- #1476: Support OMEMO on by default for chats via a config variable
4142
- #1494: Trim whitespace around messages
4243
- #1495: Mentions should always include a URI attribute
4344
- #1502: Fatal error when using prebind

docs/source/configuration.rst

+7
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,13 @@ with.
11051105
});
11061106
11071107
1108+
omemo_default
1109+
-------------
1110+
1111+
* Default: ``false``
1112+
1113+
Use OMEMO encryption by default when the chat supports it.
1114+
11081115
ping_interval
11091116
-------------
11101117

src/converse-omemo.js

+6
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ converse.plugins.add('converse-omemo', {
8484

8585
initialize () {
8686
const { _converse } = this.__super__;
87+
_converse.api.settings.update({
88+
'omemo_default': false,
89+
});
8790
this.debouncedRender = _.debounce(this.render, 50);
8891
this.devicelist = _converse.devicelists.get(_converse.bare_jid);
8992
this.devicelist.devices.on('change:bundle', this.debouncedRender, this);
@@ -1227,6 +1230,9 @@ converse.plugins.add('converse-omemo', {
12271230
supported = await _converse.contactHasOMEMOSupport(chatbox.get('jid'));
12281231
}
12291232
chatbox.set('omemo_supported', supported);
1233+
if (supported && _converse.omemo_default) {
1234+
chatbox.set('omemo_active', true);
1235+
}
12301236
}
12311237

12321238
_converse.api.waitUntil('chatBoxesInitialized').then(() =>

0 commit comments

Comments
 (0)