[MM-16389] Add icon_emoji parameter to webhooks (#11586)

[MM-16389] Add icon_emoji field to posts from incoming webhooks

To be used to substitute the profile picture on posts.
Этот коммит содержится в:
krjn
2019-07-17 09:01:18 +00:00
коммит произвёл Hanzei
родитель 1da858ac4c
Коммит dd30488a09
14 изменённых файлов: 279 добавлений и 93 удалений

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

@@ -31,6 +31,11 @@ func inSystemEmoji(emojiName string) bool {
return ok
}
func GetSystemEmojiId(emojiName string) (string, bool) {
id, found := SystemEmojis[emojiName]
return id, found
}
func (emoji *Emoji) IsValid() *AppError {
if len(emoji.Id) != 26 {
return NewAppError("Emoji.IsValid", "model.emoji.id.app_error", nil, "", http.StatusBadRequest)

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

@@ -38,6 +38,7 @@ type IncomingWebhookRequest struct {
Props StringInterface `json:"props"`
Attachments []*SlackAttachment `json:"attachments"`
Type string `json:"type"`
IconEmoji string `json:"icon_emoji"`
}
func (o *IncomingWebhook) ToJson() string {

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

@@ -50,8 +50,11 @@ const (
POST_CUSTOM_TYPE_PREFIX = "custom_"
POST_ME = "me"
PROPS_ADD_CHANNEL_MEMBER = "add_channel_member"
POST_PROPS_ADDED_USER_ID = "addedUserId"
POST_PROPS_DELETE_BY = "deleteBy"
POST_PROPS_ADDED_USER_ID = "addedUserId"
POST_PROPS_DELETE_BY = "deleteBy"
POST_PROPS_OVERRIDE_ICON_URL = "override_icon_url"
POST_PROPS_OVERRIDE_ICON_EMOJI = "override_icon_emoji"
)
type Post struct {