|
|
|
@ -82,13 +82,12 @@ object MultiDeviceProtocol {
|
|
|
|
|
// TODO: remove this after we migrate to new message receiving pipeline
|
|
|
|
|
@JvmStatic
|
|
|
|
|
fun handleConfigurationMessage(context: Context, content: SignalServiceProtos.Content, senderPublicKey: String, timestamp: Long) {
|
|
|
|
|
val userPublicKey = TextSecurePreferences.getLocalNumber(context) ?: return
|
|
|
|
|
synchronized(this) {
|
|
|
|
|
val userPublicKey = TextSecurePreferences.getLocalNumber(context) ?: return
|
|
|
|
|
if (TextSecurePreferences.getConfigurationMessageSynced(context) && !TextSecurePreferences.shouldUpdateProfile(context, timestamp)) return
|
|
|
|
|
if (senderPublicKey != userPublicKey) return
|
|
|
|
|
TextSecurePreferences.setConfigurationMessageSynced(context, true)
|
|
|
|
|
TextSecurePreferences.setLastProfileUpdateTime(context, timestamp)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val configurationMessage = ConfigurationMessage.fromProto(content) ?: return
|
|
|
|
|
|
|
|
|
@ -155,6 +154,7 @@ object MultiDeviceProtocol {
|
|
|
|
|
if (configurationMessage.contacts.isNotEmpty()) {
|
|
|
|
|
threadDatabase.notifyUpdatedFromConfig()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// TODO: handle new configuration message fields or handle in new pipeline
|
|
|
|
|
}
|
|
|
|
|
}
|