fix(common): syncFriend

This commit is contained in:
rhunk 2024-12-08 17:12:16 +01:00
parent 977d8b4327
commit a035f0ec10

View File

@ -63,12 +63,12 @@ fun AppDatabase.syncFriend(friend: MessagingFriendInfo) {
) )
) )
//sync streaks //sync streaks
friend.streaks?.takeIf { it.length > 0 }?.let { friend.streaks?.takeIf { it.length > 0 }?.also {
val streaks = getFriendStreaks(friend.userId) val streaks = getFriendStreaks(friend.userId)
database.execSQL("INSERT OR REPLACE INTO streaks (id, notify, expirationTimestamp, length) VALUES (?, ?, ?, ?)", arrayOf( database.execSQL("INSERT OR REPLACE INTO streaks (id, notify, expirationTimestamp, length) VALUES (?, ?, ?, ?)", arrayOf(
friend.userId, friend.userId,
streaks?.notify ?: true, streaks?.notify != false,
it.expirationTimestamp, it.expirationTimestamp,
it.length it.length
)) ))