diff --git a/CHANGELOG.md b/CHANGELOG.md index efaa9f8d82df446de761728bf8b345e6a30c5726..0eb781f0c85adc4152225701c6e5af053e0cf841 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 73b3caa8af10aa05d34854d4118c4dccd49ad85f..956fd5d7e1dae4f2158cdad35ea17c8292bc96fd 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