Fix missing user account data sync watcher.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -27,6 +27,7 @@ pub struct Data {
|
||||
userroomid_highlightcount: Arc<Map>,
|
||||
pduid_pdu: Arc<Map>,
|
||||
keychangeid_userid: Arc<Map>,
|
||||
roomuserdataid_accountdata: Arc<Map>,
|
||||
roomusertype_roomuserdataid: Arc<Map>,
|
||||
readreceiptid_readreceipt: Arc<Map>,
|
||||
userid_lastonetimekeyupdate: Arc<Map>,
|
||||
@@ -64,6 +65,7 @@ impl crate::Service for Service {
|
||||
userroomid_highlightcount: args.db["userroomid_highlightcount"].clone(),
|
||||
pduid_pdu: args.db["pduid_pdu"].clone(),
|
||||
keychangeid_userid: args.db["keychangeid_userid"].clone(),
|
||||
roomuserdataid_accountdata: args.db["roomuserdataid_accountdata"].clone(),
|
||||
roomusertype_roomuserdataid: args.db["roomusertype_roomuserdataid"].clone(),
|
||||
readreceiptid_readreceipt: args.db["readreceiptid_readreceipt"].clone(),
|
||||
userid_lastonetimekeyupdate: args.db["userid_lastonetimekeyupdate"].clone(),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use futures::{FutureExt, StreamExt, pin_mut, stream::FuturesUnordered};
|
||||
use ruma::{DeviceId, UserId};
|
||||
use ruma::{DeviceId, RoomId, UserId};
|
||||
use tuwunel_core::{Result, implement, trace};
|
||||
use tuwunel_database::{Interfix, Separator, serialize_key};
|
||||
|
||||
@@ -8,6 +8,7 @@ use tuwunel_database::{Interfix, Separator, serialize_key};
|
||||
pub async fn watch(&self, user_id: &UserId, device_id: &DeviceId) -> Result {
|
||||
let userdeviceid_prefix = (user_id, device_id, Interfix);
|
||||
let globaluserdata_prefix = (Separator, user_id, Interfix);
|
||||
let roomuserdataid_prefix = (Option::<&RoomId>::None, user_id, Interfix);
|
||||
let userid_prefix =
|
||||
serialize_key((user_id, Interfix)).expect("failed to serialize watch prefix");
|
||||
|
||||
@@ -56,6 +57,11 @@ pub async fn watch(&self, user_id: &UserId, device_id: &DeviceId) -> Result {
|
||||
.userid_lastonetimekeyupdate
|
||||
.watch_raw_prefix(&user_id)
|
||||
.boxed(),
|
||||
// User account data
|
||||
self.db
|
||||
.roomuserdataid_accountdata
|
||||
.watch_prefix(&roomuserdataid_prefix)
|
||||
.boxed(),
|
||||
];
|
||||
|
||||
let mut futures = FuturesUnordered::new();
|
||||
|
||||
Reference in New Issue
Block a user