mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 16:49:40 +01:00
Fix blocking bugs for internal link and sync testing.
This commit is contained in:
@@ -880,6 +880,8 @@ class GroupTable(context: Context?, databaseHelper: SignalDatabase?) :
|
||||
|
||||
val groupRecipient = recipients.getOrInsertFromGroupId(groupId)
|
||||
Recipient.live(groupRecipient).refresh()
|
||||
|
||||
notifyConversationListListeners()
|
||||
}
|
||||
|
||||
fun remove(groupId: GroupId, source: RecipientId) {
|
||||
|
||||
@@ -2889,7 +2889,7 @@ open class MessageTable(context: Context?, databaseHelper: SignalDatabase) : Dat
|
||||
) {
|
||||
val incrementUnreadMentions = retrieved.mentions.isNotEmpty() && retrieved.mentions.any { it.recipientId == Recipient.self().id }
|
||||
threads.incrementUnread(threadId, 1, if (incrementUnreadMentions) 1 else 0)
|
||||
ThreadUpdateJob.enqueue(threadId)
|
||||
ThreadUpdateJob.enqueue(threadId, true)
|
||||
}
|
||||
|
||||
if (notifyObservers) {
|
||||
@@ -3362,7 +3362,7 @@ open class MessageTable(context: Context?, databaseHelper: SignalDatabase) : Dat
|
||||
}
|
||||
|
||||
if (!message.isIdentityVerified && !message.isIdentityDefault) {
|
||||
ThreadUpdateJob.enqueue(threadId)
|
||||
ThreadUpdateJob.enqueue(threadId, !message.isSelfGroupAdd)
|
||||
}
|
||||
|
||||
TrimThreadJob.enqueueAsync(threadId)
|
||||
|
||||
@@ -1582,20 +1582,20 @@ class ThreadTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTa
|
||||
}
|
||||
|
||||
fun applyStorageSyncUpdate(recipientId: RecipientId, record: SignalContactRecord) {
|
||||
applyStorageSyncUpdate(recipientId, record.proto.archived, record.proto.markedUnread)
|
||||
applyStorageSyncUpdate(recipientId, record.proto.archived, record.proto.markedUnread, isGroup = false)
|
||||
}
|
||||
|
||||
fun applyStorageSyncUpdate(recipientId: RecipientId, record: SignalGroupV1Record) {
|
||||
applyStorageSyncUpdate(recipientId, record.proto.archived, record.proto.markedUnread)
|
||||
applyStorageSyncUpdate(recipientId, record.proto.archived, record.proto.markedUnread, isGroup = true)
|
||||
}
|
||||
|
||||
fun applyStorageSyncUpdate(recipientId: RecipientId, record: SignalGroupV2Record) {
|
||||
applyStorageSyncUpdate(recipientId, record.proto.archived, record.proto.markedUnread)
|
||||
applyStorageSyncUpdate(recipientId, record.proto.archived, record.proto.markedUnread, isGroup = true)
|
||||
}
|
||||
|
||||
fun applyStorageSyncUpdate(recipientId: RecipientId, record: SignalAccountRecord) {
|
||||
writableDatabase.withinTransaction { db ->
|
||||
applyStorageSyncUpdate(recipientId, record.proto.noteToSelfArchived, record.proto.noteToSelfMarkedUnread)
|
||||
applyStorageSyncUpdate(recipientId, record.proto.noteToSelfArchived, record.proto.noteToSelfMarkedUnread, isGroup = false)
|
||||
|
||||
db.updateAll(TABLE_NAME)
|
||||
.values(PINNED_ORDER to null)
|
||||
@@ -1631,6 +1631,8 @@ class ThreadTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTa
|
||||
}
|
||||
|
||||
if (pinnedRecipient != null) {
|
||||
getOrCreateThreadIdFor(pinnedRecipient)
|
||||
|
||||
db.update(TABLE_NAME)
|
||||
.values(PINNED_ORDER to pinnedPosition, ACTIVE to 1)
|
||||
.where("$RECIPIENT_ID = ?", pinnedRecipient.id)
|
||||
@@ -1644,11 +1646,11 @@ class ThreadTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTa
|
||||
notifyConversationListListeners()
|
||||
}
|
||||
|
||||
private fun applyStorageSyncUpdate(recipientId: RecipientId, archived: Boolean, forcedUnread: Boolean) {
|
||||
private fun applyStorageSyncUpdate(recipientId: RecipientId, archived: Boolean, forcedUnread: Boolean, isGroup: Boolean) {
|
||||
val values = ContentValues()
|
||||
values.put(ARCHIVED, if (archived) 1 else 0)
|
||||
|
||||
val threadId: Long? = getThreadIdFor(recipientId)
|
||||
val threadId: Long? = if (archived) getOrCreateThreadIdFor(recipientId, isGroup) else getThreadIdFor(recipientId)
|
||||
|
||||
if (forcedUnread) {
|
||||
values.put(READ, ReadStatus.FORCED_UNREAD.serialize())
|
||||
|
||||
Reference in New Issue
Block a user