only subscribe to omemo pep events if omemo is enabled

This commit is contained in:
Daniel Gultsch 2016-05-25 21:54:46 +02:00
parent 79796b0079
commit c65c314801

View file

@ -12,6 +12,7 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.TimeZone; import java.util.TimeZone;
import eu.siacs.conversations.Config;
import eu.siacs.conversations.crypto.axolotl.AxolotlService; import eu.siacs.conversations.crypto.axolotl.AxolotlService;
import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.utils.PhoneHelper; import eu.siacs.conversations.utils.PhoneHelper;
@ -32,8 +33,7 @@ public abstract class AbstractGenerator {
"http://jabber.org/protocol/nick+notify", "http://jabber.org/protocol/nick+notify",
"urn:xmpp:ping", "urn:xmpp:ping",
"jabber:iq:version", "jabber:iq:version",
"http://jabber.org/protocol/chatstates", "http://jabber.org/protocol/chatstates"};
AxolotlService.PEP_DEVICE_LIST_NOTIFY};
private final String[] MESSAGE_CONFIRMATION_FEATURES = { private final String[] MESSAGE_CONFIRMATION_FEATURES = {
"urn:xmpp:chat-markers:0", "urn:xmpp:chat-markers:0",
"urn:xmpp:receipts" "urn:xmpp:receipts"
@ -95,6 +95,9 @@ public abstract class AbstractGenerator {
if (mXmppConnectionService.allowMessageCorrection()) { if (mXmppConnectionService.allowMessageCorrection()) {
features.addAll(Arrays.asList(MESSAGE_CORRECTION_FEATURES)); features.addAll(Arrays.asList(MESSAGE_CORRECTION_FEATURES));
} }
if (Config.supportOmemo()) {
features.add(AxolotlService.PEP_DEVICE_LIST_NOTIFY);
}
Collections.sort(features); Collections.sort(features);
return features; return features;
} }