diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java index 99353ed303a33f29da401e89445a3a1571011936..93626e63466236e316da38bdaaf31e48c70e007b 100644 --- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java +++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java @@ -483,9 +483,18 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { publishOwnDeviceId(deviceIds); } } + final Set oldSet = this.deviceIds.get(jid); + final boolean changed = oldSet == null || oldSet.hashCode() != hash; this.deviceIds.put(jid, deviceIds); - mXmppConnectionService.updateConversationUi(); //update the lock icon - mXmppConnectionService.keyStatusUpdated(null); + if (changed) { + mXmppConnectionService.updateConversationUi(); //update the lock icon + mXmppConnectionService.keyStatusUpdated(null); + if (me) { + mXmppConnectionService.updateAccountUi(); + } + } else { + Log.d(Config.LOGTAG,"skipped device list update because it hasn't changed"); + } } public void wipeOtherPepDevices() { diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index 621ea7276bad5583c2ef02de678cf31e1cd0acbd..9b263670342e5c6dc9586b3a802a574cc3e6ff09 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -211,7 +211,6 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece Log.d(Config.LOGTAG, AxolotlService.getLogprefix(account) + "Received PEP device list " + deviceIds + " update from " + from + ", processing... "); AxolotlService axolotlService = account.getAxolotlService(); axolotlService.registerDevices(from, deviceIds); - mXmppConnectionService.updateAccountUi(); } else if (Namespace.BOOKMARKS.equals(node)) { Log.d(Config.LOGTAG,"received bookmarks from "+from); if (account.getJid().asBareJid().equals(from)) { diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index d5f09b86c1f541592fa54ff7abf0e761355562cd..9b148f131835de4f545f59e89689a8e58d821e5e 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -1110,13 +1110,13 @@ public class StartConversationActivity extends XmppActivity implements XmppConne @Override public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) { - assert (0 <= position && position < fragments.length); FragmentTransaction trans = fragmentManager.beginTransaction(); trans.remove(fragments[position]); trans.commit(); fragments[position] = null; } + @NonNull @Override public Fragment instantiateItem(@NonNull ViewGroup container, int position) { Fragment fragment = getItem(position); @@ -1149,8 +1149,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne } } - public Fragment getItem(int position) { - assert (0 <= position && position < fragments.length); + Fragment getItem(int position) { if (fragments[position] == null) { final MyListFragment listFragment = new MyListFragment(); if (position == 1) {