From 1cb1d8bd9e70319eda7bd7002b2d084842ef17f0 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Fri, 10 Feb 2023 21:41:57 +0530 Subject: [PATCH] Add additional metadata to post reminder (#22306) The webapp needs to construct the full message because the team_name needs to be inserted into the permalink. So we need to send everything in the metadata for the client to construct the message. Also, we set a custom post type for the client to easily add a custom condition. ```release-note NONE ``` --- app/post.go | 6 ++++-- model/post.go | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/post.go b/app/post.go index 720bbd43d6..f9018bf18a 100644 --- a/app/post.go +++ b/app/post.go @@ -2170,10 +2170,12 @@ func (a *App) CheckPostReminders() { "PostId": postID, "Username": metadata.Username, }), - Type: model.PostTypeDefault, + Type: model.PostTypeReminder, UserId: systemBot.UserId, Props: model.StringInterface{ - "username": systemBot.Username, + "team_name": metadata.TeamName, + "post_id": postID, + "username": metadata.Username, }, } diff --git a/model/post.go b/model/post.go index e7c11edc44..0cf604f032 100644 --- a/model/post.go +++ b/model/post.go @@ -415,6 +415,7 @@ func (o *Post) IsValid(maxPostSize int) *AppError { PostTypeAddBotTeamsChannels, PostTypeSystemWarnMetricStatus, PostTypeWelcomePost, + PostTypeReminder, PostTypeMe: default: if !strings.HasPrefix(o.Type, PostCustomTypePrefix) {