From 2faa1cd6c1882e251b1ad79f8e250b6ad23164de Mon Sep 17 00:00:00 2001 From: Imbris Date: Fri, 7 Aug 2020 00:48:35 -0400 Subject: [PATCH] Add info message in chat about group chat when joining a group --- client/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/src/lib.rs b/client/src/lib.rs index f3e7a0a33f..0fff1c773a 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -1026,6 +1026,15 @@ impl Client { // the view distance match change_notification { Added(uid, role) => { + // Check if this is a newly formed group by looking for absence of + // other non pet group members + if !matches!(role, group::Role::Pet) + && !self.group_members.values().any(|r| !matches!(r, group::Role::Pet)) + { + frontend_events.push(Event::Chat(comp::ChatType::Meta.chat_msg( + "Type /g or /group to chat with your group members" + ))); + } if self.group_members.insert(uid, role) == Some(role) { warn!( "Received msg to add uid {} to the group members but they \