From 92d944ffa5150ebc26d6a477197043fe5dda7cc0 Mon Sep 17 00:00:00 2001 From: Andrei Mihu Date: Sat, 23 May 2020 22:38:56 +0100 Subject: [PATCH] Add group ID to content of in-app notifications relating to groups. --- CHANGELOG.md | 1 + server/core_group.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efaa9f8d8..0eb781f0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr - Option for read-only globals in Lua runtime to reduce memory footprint. Enabled by default. - Independent config flags for socket read and write buffer sizes. - Expose session fields in authoritative match join attempt contexts. +- Add group ID to content of in-app notifications relating to groups. ### Changed - Replace metrics implementation. diff --git a/server/core_group.go b/server/core_group.go index 73b3caa8a..956fd5d7e 100644 --- a/server/core_group.go +++ b/server/core_group.go @@ -319,7 +319,7 @@ WHERE (id = $1) AND (disable_time = '1970-01-01 00:00:00 UTC')` // If it's a private group notify superadmins/admins that someone has requested to join. // Prepare notification data. - notificationContentBytes, err := json.Marshal(map[string]string{"username": username}) + notificationContentBytes, err := json.Marshal(map[string]string{"group_id": groupID.String(), "username": username}) if err != nil { logger.Error("Could not encode notification content.", zap.Error(err)) } else { @@ -580,7 +580,7 @@ func AddGroupUsers(ctx context.Context, logger *zap.Logger, db *sql.DB, router M } // Prepare notification data. - notificationContentBytes, err := json.Marshal(map[string]string{"name": groupName.String}) + notificationContentBytes, err := json.Marshal(map[string]string{"group_id": groupID.String(), "name": groupName.String}) if err != nil { logger.Error("Could not encode notification content.", zap.Error(err)) return err -- GitLab