don't push default muc conf twice

This commit is contained in:
Daniel Gultsch 2016-05-27 10:35:00 +02:00
parent 21ebb35e44
commit 44833c1499
3 changed files with 14 additions and 1 deletions

View File

@ -18,6 +18,8 @@ import eu.siacs.conversations.xmpp.pep.Avatar;
@SuppressLint("DefaultLocale")
public class MucOptions {
private boolean mAutoPushConfiguration = true;
public Account getAccount() {
return this.conversation.getAccount();
}
@ -39,6 +41,14 @@ public class MucOptions {
}
}
public void flagNoAutoPushConfiguration() {
mAutoPushConfiguration = false;
}
public boolean autoPushConfiguration() {
return mAutoPushConfiguration;
}
public enum Affiliation {
OWNER("owner", 4, R.string.owner),
ADMIN("admin", 3, R.string.admin),

View File

@ -78,7 +78,7 @@ public class PresenceParser extends AbstractParser implements
} else {
mucOptions.addUser(user);
}
if (codes.contains(MucOptions.STATUS_CODE_ROOM_CREATED)) {
if (codes.contains(MucOptions.STATUS_CODE_ROOM_CREATED) && mucOptions.autoPushConfiguration()) {
Log.d(Config.LOGTAG,mucOptions.getAccount().getJid().toBareJid()
+": room '"
+mucOptions.getConversation().getJid().toBareJid()

View File

@ -1832,6 +1832,9 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
account.pendingConferenceLeaves.remove(conversation);
if (account.getStatus() == Account.State.ONLINE) {
conversation.resetMucOptions();
if (onConferenceJoined != null) {
conversation.getMucOptions().flagNoAutoPushConfiguration();
}
conversation.setHasMessagesLeftOnServer(false);
fetchConferenceConfiguration(conversation, new OnConferenceConfigurationFetched() {