[MM-16232] ID loaded push notifications (#13137)

* Update BuildPushNotificationMessage (#12974)

* Update BuildPushNotificationMessage

* Included Category, Version, and Type

* Remove unnecessary function args

* [MM-16232] Build and return fetched notification (#13085)

* Build and return fetched notification

* Remove check on PushNotificationContents

* Ran i18n-extract

* Get UserId from session

* Re-add ReturnStatusOK

* Remove UserId from PushNotificationAck

* Always include channel name

* [MM-16232] Return after writing response and add default message (#13127)

* Return after writing response and add default message

* Include channel ID as well

* Localize default message

* Fix i18n
Этот коммит содержится в:
Miguel Alatzar
2019-11-18 15:42:51 -08:00
коммит произвёл Christopher Speller
родитель 2571d97723
Коммит d44d563ef3
9 изменённых файлов: 259 добавлений и 45 удалений

Просмотреть файл

@@ -151,7 +151,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
updateMentionChans = append(updateMentionChans, umc)
}
notification := &postNotification{
notification := &PostNotification{
post: post,
channel: channel,
profileMap: profileMap,
@@ -638,7 +638,7 @@ func (a *App) getMentionKeywordsInChannel(profiles map[string]*model.User, lookF
}
// Represents either an email or push notification and contains the fields required to send it to any user.
type postNotification struct {
type PostNotification struct {
channel *model.Channel
post *model.Post
profileMap map[string]*model.User
@@ -648,7 +648,7 @@ type postNotification struct {
// Returns the name of the channel for this notification. For direct messages, this is the sender's name
// preceeded by an at sign. For group messages, this is a comma-separated list of the members of the
// channel, with an option to exclude the recipient of the message from that list.
func (n *postNotification) GetChannelName(userNameFormat string, excludeId string) string {
func (n *PostNotification) GetChannelName(userNameFormat, excludeId string) string {
switch n.channel.Type {
case model.CHANNEL_DIRECT:
return n.sender.GetDisplayNameWithPrefix(userNameFormat, "@")
@@ -670,7 +670,7 @@ func (n *postNotification) GetChannelName(userNameFormat string, excludeId strin
// Returns the name of the sender of this notification, accounting for things like system messages
// and whether or not the username has been overridden by an integration.
func (n *postNotification) GetSenderName(userNameFormat string, overridesAllowed bool) string {
func (n *PostNotification) GetSenderName(userNameFormat string, overridesAllowed bool) string {
if n.post.IsSystemMessage() {
return utils.T("system.message.name")
}