update ui after bookmark change

This commit is contained in:
Daniel Gultsch 2019-09-28 21:46:27 +02:00
parent f530e395ca
commit b96ef1e591
3 changed files with 14 additions and 1 deletions

View File

@ -417,7 +417,7 @@ public class MucOptions {
}
}
private String getProposedNick() {
public String getProposedNick() {
final Bookmark bookmark = this.conversation.getBookmark();
final String bookmarkedNick = normalize(account.getJid(), bookmark == null ? null : bookmark.getNick());
if (bookmarkedNick != null) {

View File

@ -238,7 +238,9 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
if (item != null) {
final Bookmark bookmark = Bookmark.parseFromItem(item, account);
if (bookmark != null) {
account.putBookmark(bookmark);
mXmppConnectionService.processModifiedBookmark(bookmark);
mXmppConnectionService.updateConversationUi();
}
}
if (retract != null) {
@ -247,6 +249,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
account.removeBookmark(id);
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": deleted bookmark for "+id);
mXmppConnectionService.processDeletedBookmark(account, id);
mXmppConnectionService.updateConversationUi();
}
}
} else {

View File

@ -1621,6 +1621,16 @@ public class XmppConnectionService extends Service {
if (pep && synchronizeWithBookmarks && !bookmark.autojoin()) {
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": archiving conference ("+conversation.getJid()+") after receiving pep");
archiveConversation(conversation, false);
} else {
final MucOptions mucOptions = conversation.getMucOptions();
if (mucOptions.getError() == MucOptions.Error.NICK_IN_USE) {
final String current = mucOptions.getActualNick();
final String proposed = mucOptions.getProposedNick();
if (current != null && !current.equals(proposed)) {
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": proposed nick changed after bookmark push "+current+"->"+proposed);
joinMuc(conversation);
}
}
}
} else if (synchronizeWithBookmarks && bookmark.autojoin()) {
conversation = findOrCreateConversation(account, bookmark.getFullJid(), true, true, false);