Add FIXME

This commit is contained in:
nielsandriesse 2020-06-15 14:01:09 +10:00
parent 132ca11692
commit f85ad3564b
2 changed files with 3 additions and 7 deletions

View File

@ -197,7 +197,7 @@ object MultiDeviceProtocol {
TextSecurePreferences.setMultiDevice(context, true)
LokiFileServerAPI.shared.addDeviceLink(deviceLink)
org.thoughtcrime.securesms.loki.protocol.SessionMetaProtocol.handleProfileUpdateIfNeeded(context, content)
org.thoughtcrime.securesms.loki.protocol.SessionMetaProtocol.handleProfileKey(context, content)
org.thoughtcrime.securesms.loki.protocol.SessionMetaProtocol.duplicate_handleProfileKey(context, content)
}
@JvmStatic

View File

@ -48,15 +48,11 @@ object SessionMetaProtocol {
}
}
// FIXME: Basically a duplicate of PushDecryptJob's handleProfileKey
@JvmStatic
fun handleProfileKey(context: Context, content: SignalServiceContent) {
fun duplicate_handleProfileKey(context: Context, content: SignalServiceContent) {
val message = content.dataMessage.get()
if (!message.profileKey.isPresent) { return }
/*
If we get a profile key then we don't need to map it to the primary device.
For now a profile key is mapped one-to-one to avoid secondary devices setting the incorrect avatar for a primary device.
*/
val database = DatabaseFactory.getRecipientDatabase(context)
val recipient = Recipient.from(context, Address.fromSerialized(content.sender), false)
if (recipient.profileKey == null || !MessageDigest.isEqual(recipient.profileKey, message.profileKey.get())) {