fix private read receipt support

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-12-10 22:54:19 -05:00
commit badb83484f
No known key found for this signature in database
4 changed files with 140 additions and 80 deletions

View file

@ -79,15 +79,15 @@ impl Data {
.ignore_err()
}
pub(super) fn private_read_set(&self, room_id: &RoomId, user_id: &UserId, count: u64) {
pub(super) fn private_read_set(&self, room_id: &RoomId, user_id: &UserId, pdu_count: u64) {
let key = (room_id, user_id);
let next_count = self.services.globals.next_count().unwrap();
self.roomuserid_privateread.put(key, count);
self.roomuserid_privateread.put(key, pdu_count);
self.roomuserid_lastprivatereadupdate.put(key, next_count);
}
pub(super) async fn private_read_get(&self, room_id: &RoomId, user_id: &UserId) -> Result<u64> {
pub(super) async fn private_read_get_count(&self, room_id: &RoomId, user_id: &UserId) -> Result<u64> {
let key = (room_id, user_id);
self.roomuserid_privateread.qry(&key).await.deserialized()
}