From 5486a68bfa7fcbe0125ca2a0178c74d716edd230 Mon Sep 17 00:00:00 2001
From: Paul Makles <paulmakles@gmail.com>
Date: Sun, 24 Jan 2021 09:20:43 +0000
Subject: [PATCH] Move group leave into posthandle hook.

---
 src/notifications/events.rs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/notifications/events.rs b/src/notifications/events.rs
index b1df740..92c161e 100644
--- a/src/notifications/events.rs
+++ b/src/notifications/events.rs
@@ -100,12 +100,6 @@ pub fn prehandle_hook(notification: &ClientboundNotification) {
                 }
             }
         }
-        ClientboundNotification::ChannelGroupLeave { id, user } => {
-            get_hive()
-                .hive
-                .unsubscribe(&user.to_string(), &id.to_string())
-                .ok();
-        }
         ClientboundNotification::UserRelationship { id, user, status } => {
             if status != &RelationshipStatus::None {
                 subscribe_if_exists(id.clone(), user.clone()).ok();
@@ -128,6 +122,12 @@ pub fn posthandle_hook(notification: &ClientboundNotification) {
                     .ok();
             }
         }
+        ClientboundNotification::ChannelGroupLeave { id, user } => {
+            get_hive()
+                .hive
+                .unsubscribe(&user.to_string(), &id.to_string())
+                .ok();
+        }
         _ => {}
     }
 }
-- 
GitLab