mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Rotate profile key when contact hidden.
This commit is contained in:
@@ -5,6 +5,8 @@ import androidx.annotation.CheckResult
|
||||
import io.reactivex.rxjava3.core.Completable
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
||||
import org.thoughtcrime.securesms.jobs.RotateProfileKeyJob
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.recipients.RecipientUtil
|
||||
|
||||
@@ -31,7 +33,11 @@ class ContactsManagementRepository(context: Context) {
|
||||
error("Cannot hide groups, self, or distribution lists.")
|
||||
}
|
||||
|
||||
SignalDatabase.recipients.markHidden(recipient.id)
|
||||
val rotateProfileKey = !recipient.hasGroupsInCommon()
|
||||
SignalDatabase.recipients.markHidden(recipient.id, rotateProfileKey)
|
||||
if (rotateProfileKey) {
|
||||
ApplicationDependencies.getJobManager().add(RotateProfileKeyJob())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user