From a39adb64c68d40dc9e6827e95d4b4e41c983c1b4 Mon Sep 17 00:00:00 2001
From: Paul <paulmakles@gmail.com>
Date: Wed, 26 May 2021 13:19:03 +0100
Subject: [PATCH] Hive: Don't send out sync for irrelevant users.

---
 set_version.sh                 |  2 +-
 src/notifications/websocket.rs | 10 +++++++---
 src/version.rs                 |  2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/set_version.sh b/set_version.sh
index 0fe4c09..89ab4fd 100755
--- a/set_version.sh
+++ b/set_version.sh
@@ -1,3 +1,3 @@
 #!/bin/bash
-export version=0.4.2-alpha.1
+export version=0.4.2-alpha.2
 echo "pub const VERSION: &str = \"${version}\";" > src/version.rs
diff --git a/src/notifications/websocket.rs b/src/notifications/websocket.rs
index cc0e06c..d9d8e70 100644
--- a/src/notifications/websocket.rs
+++ b/src/notifications/websocket.rs
@@ -242,10 +242,14 @@ pub fn publish(ids: Vec<String>, notification: ClientboundNotification) {
         let users = USERS.read().unwrap();
         for id in ids {
             // Block certain notifications from reaching users that aren't meant to see them.
-            if let ClientboundNotification::UserRelationship { id: user_id, .. } = &notification {
-                if &id != user_id {
-                    continue;
+            match &notification {
+                ClientboundNotification::UserRelationship { id: user_id, .. } |
+                ClientboundNotification::UserSettingsUpdate { id: user_id, .. } => {
+                    if &id != user_id {
+                        continue;
+                    }
                 }
+                _ => {}
             }
 
             if let Some(mut arr) = users.get_left(&id) {
diff --git a/src/version.rs b/src/version.rs
index 45f4f47..b457d3a 100644
--- a/src/version.rs
+++ b/src/version.rs
@@ -1 +1 @@
-pub const VERSION: &str = "0.4.2-alpha.1";
+pub const VERSION: &str = "0.4.2-alpha.2";
-- 
GitLab