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") @SuppressLint("DefaultLocale")
public class MucOptions { public class MucOptions {
private boolean mAutoPushConfiguration = true;
public Account getAccount() { public Account getAccount() {
return this.conversation.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 { public enum Affiliation {
OWNER("owner", 4, R.string.owner), OWNER("owner", 4, R.string.owner),
ADMIN("admin", 3, R.string.admin), ADMIN("admin", 3, R.string.admin),

View File

@ -78,7 +78,7 @@ public class PresenceParser extends AbstractParser implements
} else { } else {
mucOptions.addUser(user); 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() Log.d(Config.LOGTAG,mucOptions.getAccount().getJid().toBareJid()
+": room '" +": room '"
+mucOptions.getConversation().getJid().toBareJid() +mucOptions.getConversation().getJid().toBareJid()

View File

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