revert: disable user update events (#593)

* Revert "fix: cut presence traffic too while we engineer a new events architecture (#561)"

This reverts commit 1f8ea963ad.

* Revert "fix: cut events traffic while we engineer a new events architecture (#559)"

This reverts commit a11986ba1a.

* chore: only revert user update
This commit is contained in:
Paul Makles
2026-02-17 22:13:17 +00:00
committed by GitHub
parent 8849d03cd2
commit 1c98ead695
3 changed files with 35 additions and 11 deletions

View File

@@ -398,7 +398,8 @@ impl State {
}
/// Push presence change to the user and all associated server topics
pub async fn broadcast_presence_change(&self, target: bool) {
pub async fn broadcast_presence_change(&self, _target: bool) {
// disabled events
// if if let Some(status) = &self.cache.users.get(&self.cache.user_id).unwrap().status {
// status.presence != Some(Presence::Invisible)
// } else {

View File

@@ -463,8 +463,31 @@ async fn worker(
};
match payload {
ClientMessage::BeginTyping { .. } => {}
ClientMessage::EndTyping { .. } => {}
// disabled events
// ClientMessage::BeginTyping { channel } => {
// if !subscribed.read().await.contains(&channel) {
// continue;
// }
// EventV1::ChannelStartTyping {
// id: channel.clone(),
// user: user_id.clone(),
// }
// .p(channel.clone())
// .await;
// }
// ClientMessage::EndTyping { channel } => {
// if !subscribed.read().await.contains(&channel) {
// continue;
// }
// EventV1::ChannelStopTyping {
// id: channel.clone(),
// user: user_id.clone(),
// }
// .p(channel.clone())
// .await;
// }
ClientMessage::Subscribe { server_id } => {
let mut servers = active_servers.lock().await;
let has_item = servers.contains_key(&server_id);

View File

@@ -653,14 +653,14 @@ impl User {
self.apply_options(partial.clone());
db.update_user(&self.id, &partial, remove.clone()).await?;
// EventV1::UserUpdate {
// id: self.id.clone(),
// data: partial.into(),
// clear: remove.into_iter().map(|v| v.into()).collect(),
// event_id: Some(Ulid::new().to_string()),
// }
// .p_user(self.id.clone(), db)
// .await;
EventV1::UserUpdate {
id: self.id.clone(),
data: partial.into(),
clear: remove.into_iter().map(|v| v.into()).collect(),
event_id: Some(Ulid::new().to_string()),
}
.p_user(self.id.clone(), db)
.await;
Ok(())
}