added a few TODOs in regards to the handling of inactive devices

This commit is contained in:
Daniel Gultsch 2018-10-04 18:48:45 +02:00
parent 04ac2264e8
commit bfa63e13c5
3 changed files with 5 additions and 3 deletions

View file

@ -525,6 +525,7 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
if (packet.getType() == IqPacket.TYPE.TIMEOUT) {
Log.d(Config.LOGTAG, getLogprefix(account) + "Timeout received while retrieving own Device Ids.");
} else {
//TODO consider calling registerDevices only after item-not-found to account for broken PEPs
Element item = mXmppConnectionService.getIqParser().getItem(packet);
Set<Integer> deviceIds = mXmppConnectionService.getIqParser().deviceIds(item);
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": retrieved own device list: " + deviceIds);
@ -1162,8 +1163,8 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
Set<SignalProtocolAddress> addresses = new HashSet<>();
for (Jid jid : getCryptoTargets(conversation)) {
Log.d(Config.LOGTAG, AxolotlService.getLogprefix(account) + "Finding devices without session for " + jid);
Set<Integer> ids = deviceIds.get(jid);
if (deviceIds.get(jid) != null && !ids.isEmpty()) {
final Set<Integer> ids = deviceIds.get(jid);
if (ids != null && !ids.isEmpty()) {
for (Integer foreignId : ids) {
SignalProtocolAddress address = new SignalProtocolAddress(jid.toString(), foreignId);
if (sessions.get(address) == null) {

View file

@ -110,6 +110,7 @@ public class XmppAxolotlSession implements Comparable<XmppAxolotlSession> {
}
if (!status.isActive()) {
setTrust(status.toActive());
//TODO: also (re)add to device list?
}
} else {
throw new CryptoFailedException("not encrypting omemo message from fingerprint "+getFingerprint()+" because it was marked as compromised");

View file

@ -1076,7 +1076,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
hasKeys = true;
}
}
if (hasKeys && Config.supportOmemo()) {
if (hasKeys && Config.supportOmemo()) { //TODO: either the button should be visible if we print an active device or the device list should be fed with reactived devices
this.binding.otherDeviceKeysCard.setVisibility(View.VISIBLE);
Set<Integer> otherDevices = mAccount.getAxolotlService().getOwnDeviceIds();
if (otherDevices == null || otherDevices.isEmpty()) {