mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 14:53:40 +00:00
Trigger event when authorisation is accepted.
This commit is contained in:
parent
0b49d7ae0d
commit
7d1883cfd2
@ -1067,7 +1067,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unimplemented
|
// Unimplemented for REQUEST
|
||||||
if (authorisation.getType() != LokiPairingAuthorisation.Type.GRANT) { return; }
|
if (authorisation.getType() != LokiPairingAuthorisation.Type.GRANT) { return; }
|
||||||
Log.d("Loki", "Receiving pairing authorisation from: " + authorisation.getPrimaryDevicePubKey());
|
Log.d("Loki", "Receiving pairing authorisation from: " + authorisation.getPrimaryDevicePubKey());
|
||||||
|
|
||||||
@ -1077,12 +1077,13 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
DatabaseFactory.getLokiAPIDatabase(context).insertOrUpdatePairingAuthorisation(authorisation);
|
DatabaseFactory.getLokiAPIDatabase(context).insertOrUpdatePairingAuthorisation(authorisation);
|
||||||
TextSecurePreferences.setIsSecondaryDevice(context, true);
|
TextSecurePreferences.setIsSecondaryDevice(context, true);
|
||||||
|
|
||||||
|
// Send out accept event
|
||||||
|
LokiDeviceLinkingSession.Companion.getShared().acceptedLinkingRequest(authorisation);
|
||||||
|
|
||||||
// Propagate the updates to the file server
|
// Propagate the updates to the file server
|
||||||
LokiStorageAPI storageAPI = LokiStorageAPI.Companion.getShared();
|
LokiStorageAPI storageAPI = LokiStorageAPI.Companion.getShared();
|
||||||
if (storageAPI != null) { storageAPI.updateOurDeviceMappings(); }
|
if (storageAPI != null) { storageAPI.updateOurDeviceMappings(); }
|
||||||
|
|
||||||
// TODO: Trigger an event here?
|
|
||||||
|
|
||||||
// Update display names
|
// Update display names
|
||||||
if (content.senderDisplayName.isPresent() && content.senderDisplayName.get().length() > 0) {
|
if (content.senderDisplayName.isPresent() && content.senderDisplayName.get().length() > 0) {
|
||||||
setDisplayName(envelope.getSource(), content.senderDisplayName.get());
|
setDisplayName(envelope.getSource(), content.senderDisplayName.get());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user