only allow OMEMO in members only MUCs

This commit is contained in:
Samuel Hand 2018-07-18 21:42:33 +01:00
parent c299a12b8e
commit f2283778f6

View file

@ -337,7 +337,7 @@ public class Manager : StreamInteractionModule, Object {
if (stream_interactor.get_module(MucManager.IDENTITY).is_groupchat(conversation.counterpart, conversation.account)){ if (stream_interactor.get_module(MucManager.IDENTITY).is_groupchat(conversation.counterpart, conversation.account)){
Xep.Muc.Flag? flag = stream.get_flag(Xep.Muc.Flag.IDENTITY); Xep.Muc.Flag? flag = stream.get_flag(Xep.Muc.Flag.IDENTITY);
if (flag == null) return false; if (flag == null) return false;
if (flag.has_room_feature(conversation.counterpart, Xep.Muc.Feature.NON_ANONYMOUS)) { if (flag.has_room_feature(conversation.counterpart, Xep.Muc.Feature.NON_ANONYMOUS) && flag.has_room_feature(conversation.counterpart, Xep.Muc.Feature.MEMBERS_ONLY)) {
foreach(Jid jid in stream_interactor.get_module(MucManager.IDENTITY).get_offline_members(conversation.counterpart, conversation.account)) { foreach(Jid jid in stream_interactor.get_module(MucManager.IDENTITY).get_offline_members(conversation.counterpart, conversation.account)) {
if (!((!)module).is_known_address(jid.bare_jid)) return false; if (!((!)module).is_known_address(jid.bare_jid)) return false;
} }