don't push default muc conf twice
This commit is contained in:
parent
21ebb35e44
commit
44833c1499
|
@ -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),
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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() {
|
||||
|
||||
|
|
Loading…
Reference in a new issue