Prevent accepted group message request from resetting when restored from storage.

This commit is contained in:
Cody Henthorne
2026-06-09 17:21:47 -04:00
parent 8560ab0515
commit f2fd3e63c8
3 changed files with 37 additions and 0 deletions
@@ -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)
@@ -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()