mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-08-07 22:06:06 +01:00
Prevent accepted group message request from resetting when restored from storage.
This commit is contained in:
@@ -2128,6 +2128,15 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
}
|
||||
}
|
||||
|
||||
fun isProfileSharing(groupId: GroupId): Boolean {
|
||||
return readableDatabase
|
||||
.select(PROFILE_SHARING)
|
||||
.from(TABLE_NAME)
|
||||
.where("$GROUP_ID = ?", groupId.toString())
|
||||
.run()
|
||||
.readToSingleBoolean(defaultValue = false)
|
||||
}
|
||||
|
||||
fun setNotificationChannel(id: RecipientId, notificationChannel: String?) {
|
||||
val contentValues = ContentValues(1).apply {
|
||||
put(NOTIFICATION_CHANNEL, notificationChannel)
|
||||
|
||||
+5
@@ -713,6 +713,11 @@ class GroupsV2StateProcessor private constructor(
|
||||
return
|
||||
}
|
||||
|
||||
if (SignalDatabase.recipients.isProfileSharing(groupId)) {
|
||||
Log.i(TAG, "Profile sharing already enabled for $groupId. Leaving as-is.")
|
||||
return
|
||||
}
|
||||
|
||||
val selfAsMember = DecryptedGroupUtil.findMemberByAci(newLocalState.members, aci).orNull()
|
||||
val selfAsPending = DecryptedGroupUtil.findPendingByServiceId(newLocalState.pendingMembers, aci).orNull()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user