#4755 Combining consecutive user join/leave system messages to single message and few other changes. (#5945)

fix 7 and 8

remove @ at "{username} joined the channel"

refactor and update test
Этот коммит содержится в:
Debanshu Kundu
2017-07-31 23:47:21 +05:30
коммит произвёл Saturnino Abril
родитель 59992ae4a4
Коммит 8a91235fb3
14 изменённых файлов: 574 добавлений и 66 удалений

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

@@ -205,6 +205,15 @@ func (o *Post) IsSystemMessage() bool {
return len(o.Type) >= len(POST_SYSTEM_MESSAGE_PREFIX) && o.Type[:len(POST_SYSTEM_MESSAGE_PREFIX)] == POST_SYSTEM_MESSAGE_PREFIX
}
func (o *Post) IsUserActivitySystemMessage() bool {
return o.Type == POST_JOIN_LEAVE ||
o.Type == POST_JOIN_CHANNEL ||
o.Type == POST_LEAVE_CHANNEL ||
o.Type == POST_ADD_REMOVE ||
o.Type == POST_ADD_TO_CHANNEL ||
o.Type == POST_REMOVE_FROM_CHANNEL
}
func (p *Post) Patch(patch *PostPatch) {
if patch.IsPinned != nil {
p.IsPinned = *patch.IsPinned