Fix devicelist update handling
No longer store own device ID (so that we don't encrypt messages for ourselves), verify that own device ID is present in update list (otherwise republish), reflect update in UI.
This commit is contained in:
parent
7a962e5180
commit
968410ae33
|
@ -640,10 +640,15 @@ public class AxolotlService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerDevices(final Jid jid, @NonNull final Set<Integer> deviceIds) {
|
public void registerDevices(final Jid jid, @NonNull final Set<Integer> deviceIds) {
|
||||||
|
if(deviceIds.contains(getOwnDeviceId())) {
|
||||||
|
Log.d(Config.LOGTAG, "Skipping own Device ID:"+ jid + ":"+getOwnDeviceId());
|
||||||
|
deviceIds.remove(getOwnDeviceId());
|
||||||
|
}
|
||||||
for(Integer i:deviceIds) {
|
for(Integer i:deviceIds) {
|
||||||
Log.d(Config.LOGTAG, "Adding Device ID:"+ jid + ":"+i);
|
Log.d(Config.LOGTAG, "Adding Device ID:"+ jid + ":"+i);
|
||||||
}
|
}
|
||||||
this.deviceIds.put(jid, deviceIds);
|
this.deviceIds.put(jid, deviceIds);
|
||||||
|
publishOwnDeviceIdIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void publishOwnDeviceIdIfNeeded() {
|
public void publishOwnDeviceIdIfNeeded() {
|
||||||
|
|
|
@ -194,6 +194,7 @@ public class MessageParser extends AbstractParser implements
|
||||||
Set<Integer> deviceIds = mXmppConnectionService.getIqParser().deviceIds(item);
|
Set<Integer> deviceIds = mXmppConnectionService.getIqParser().deviceIds(item);
|
||||||
AxolotlService axolotlService = account.getAxolotlService();
|
AxolotlService axolotlService = account.getAxolotlService();
|
||||||
axolotlService.registerDevices(from, deviceIds);
|
axolotlService.registerDevices(from, deviceIds);
|
||||||
|
mXmppConnectionService.updateAccountUi();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue