Add @ prefix for sender username in push notifications (#11934)

* Add @ prefix for sender username in push notifications

* de-duplicating code
Этот коммит содержится в:
Elias Nahum
2019-08-23 09:46:43 -04:00
коммит произвёл Harrison Healey
родитель f753819a66
Коммит 24e0d6f00d
4 изменённых файлов: 58 добавлений и 10 удалений

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

@@ -640,7 +640,7 @@ type postNotification struct {
func (n *postNotification) GetChannelName(userNameFormat string, excludeId string) string {
switch n.channel.Type {
case model.CHANNEL_DIRECT:
return n.sender.GetDisplayName(userNameFormat)
return n.sender.GetDisplayNameWithPrefix(userNameFormat, "@")
case model.CHANNEL_GROUP:
names := []string{}
for _, user := range n.profileMap {
@@ -670,7 +670,7 @@ func (n *postNotification) GetSenderName(userNameFormat string, overridesAllowed
}
}
return n.sender.GetDisplayName(userNameFormat)
return n.sender.GetDisplayNameWithPrefix(userNameFormat, "@")
}
// addMentionedUsers will add the mentioned user id in the struct's list for mentioned users