Update pleroma status cache on reaction

This commit is contained in:
Karol Kosek 2020-10-19 22:05:13 +02:00 committed by fruye
parent 5d09d9a77c
commit 2c55491274
2 changed files with 7 additions and 0 deletions

View File

@ -42,6 +42,10 @@ class CacheUpdater @Inject constructor(
}
is PinEvent ->
timelineDao.setPinned(accountId, event.statusId, event.pinned)
is EmojiReactEvent -> {
val pleromaString = gson.toJson(event.newStatus.pleroma)
timelineDao.setPleroma(accountId, event.newStatus.id, pleromaString)
}
}
}
}

View File

@ -194,6 +194,9 @@ WHERE timelineUserId = :accountId AND (serverId = :statusId OR reblogServerId =
)
abstract suspend fun setPinned(accountId: Long, statusId: String, pinned: Boolean)
@Query("""UPDATE TimelineStatusEntity SET pleroma = :pleroma WHERE timelineUserId = :accountId AND (serverId = :statusId OR reblogServerId = :statusId)""")
abstract fun setPleroma(accountId: Long, statusId: String, pleroma: String)
@Query(
"""DELETE FROM TimelineStatusEntity
WHERE timelineUserId = :accountId AND authorServerId IN (