allow axolotl header to be empty in empty mucs

This commit is contained in:
Daniel Gultsch 2018-01-27 09:15:47 +01:00
parent a5256c3e83
commit 3e111e7f58

View file

@ -1212,10 +1212,11 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
} }
@Nullable @Nullable
private boolean buildHeader(XmppAxolotlMessage axolotlMessage, Conversation conversation) { private boolean buildHeader(XmppAxolotlMessage axolotlMessage, Conversation c) {
Set<XmppAxolotlSession> remoteSessions = findSessionsForConversation(conversation); Set<XmppAxolotlSession> remoteSessions = findSessionsForConversation(c);
final boolean acceptEmpty = c.getMode() == Conversation.MODE_MULTI && c.getMucOptions().getUserCount() == 0;
Collection<XmppAxolotlSession> ownSessions = findOwnSessions(); Collection<XmppAxolotlSession> ownSessions = findOwnSessions();
if (remoteSessions.isEmpty()) { if (remoteSessions.isEmpty() && !acceptEmpty) {
return false; return false;
} }
for (XmppAxolotlSession session : remoteSessions) { for (XmppAxolotlSession session : remoteSessions) {