summaryrefslogtreecommitdiffstats
path: root/model/post.go
diff options
context:
space:
mode:
authorDebanshu Kundu <debanshu.kundu@joshtechnologygroup.com>2017-07-31 23:47:21 +0530
committerSaturnino Abril <saturnino.abril@gmail.com>2017-08-01 02:17:21 +0800
commit8a91235fb3cdc8d094dbc2eaa0d7baa447132b3c (patch)
tree28496b27f4da93baa8707bf0690ef88f8cdcc178 /model/post.go
parent59992ae4a4638006ec1489dd834151b258c1728c (diff)
downloadchat-8a91235fb3cdc8d094dbc2eaa0d7baa447132b3c.tar.gz
chat-8a91235fb3cdc8d094dbc2eaa0d7baa447132b3c.tar.bz2
chat-8a91235fb3cdc8d094dbc2eaa0d7baa447132b3c.zip
#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
Diffstat (limited to 'model/post.go')
-rw-r--r--model/post.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/model/post.go b/model/post.go
index 55e6f591d..67a418700 100644
--- a/model/post.go
+++ b/model/post.go
@@ -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