aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/stream_module.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2018-06-19 12:52:00 +0200
committerSamuel Hand <samuel.hand@openmailbox.org>2018-06-26 15:42:02 +0100
commit638d81d67ecd6c7c8be7fd67aeaf15d16486f8e9 (patch)
treeea1cf3c5f28477bc928777ea0379d2616170fd0b /plugins/omemo/src/stream_module.vala
parent2a8352c5439129798b5141ec021b3b9405840a8a (diff)
downloaddino-638d81d67ecd6c7c8be7fd67aeaf15d16486f8e9.tar.gz
dino-638d81d67ecd6c7c8be7fd67aeaf15d16486f8e9.zip
More cleanup and database modifications
Diffstat (limited to 'plugins/omemo/src/stream_module.vala')
-rw-r--r--plugins/omemo/src/stream_module.vala14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/omemo/src/stream_module.vala b/plugins/omemo/src/stream_module.vala
index 83a3dd54..2c792a2f 100644
--- a/plugins/omemo/src/stream_module.vala
+++ b/plugins/omemo/src/stream_module.vala
@@ -102,20 +102,24 @@ public class StreamModule : XmppStreamModule {
}
public void untrust_device(Jid jid, int device_id) {
- if(device_lists.has_key(jid) && device_lists[jid].contains(device_id))
+ if (device_lists.has_key(jid) && device_lists[jid].contains(device_id)) {
device_lists[jid].remove(device_id);
- if(store.contains_session(new Address(jid.bare_jid.to_string(), device_id)))
+ }
+ if (store.contains_session(new Address(jid.bare_jid.to_string(), device_id))) {
store.delete_session(new Address(jid.bare_jid.to_string(), device_id));
+ }
}
public void trust_device(Jid jid, int device_id) {
- if(is_ignored_device(jid, device_id)){
+ if (is_ignored_device(jid, device_id)){
ignored_devices[jid].remove(device_id);
}
- if(!device_lists.has_key(jid))
+ if (!device_lists.has_key(jid)) {
device_lists[jid] = new ArrayList<int32>();
- if(!device_lists[jid].contains(device_id))
+ }
+ if (!device_lists[jid].contains(device_id)) {
device_lists[jid].add(device_id);
+ }
}
private StanzaNode create_encrypted_key(uint8[] key, Address address) throws GLib.Error {