mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Revert " #4755 Combining consecutive user join/leave system messages to single message and few other changes." (#7072)
* Revert "PLT-6603: Don't return all posts on invalid query. (#7061)" This reverts commit25a2013890. * Revert " #4755 Combining consecutive user join/leave system messages to single message and few other changes. (#5945)" This reverts commit8a91235fb3.
This commit is contained in:
committed by
Joram Wilander
parent
b023b89155
commit
88f398ffdd
@@ -205,15 +205,6 @@ 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
|
||||
|
||||
@@ -113,48 +113,3 @@ func TestPostIsSystemMessage(t *testing.T) {
|
||||
t.Fatalf("TestPostIsSystemMessage failed, expected post2.IsSystemMessage() to be true")
|
||||
}
|
||||
}
|
||||
|
||||
func TestPostIsUserActivitySystemMessage(t *testing.T) {
|
||||
post1 := Post{Message: "test_1"}
|
||||
post1.PreSave()
|
||||
|
||||
if post1.IsUserActivitySystemMessage() {
|
||||
t.Fatalf("TestPostIsUserActivitySystemMessage failed, expected post1.IsSystemMessage() to be false")
|
||||
}
|
||||
|
||||
post2 := Post{Message: "test_2", Type: POST_JOIN_LEAVE}
|
||||
post2.PreSave()
|
||||
if !post2.IsUserActivitySystemMessage() {
|
||||
t.Fatalf("TestPostIsUserActivitySystemMessage failed, expected post2.IsSystemMessage() to be true")
|
||||
}
|
||||
|
||||
post3 := Post{Message: "test_3", Type: POST_JOIN_CHANNEL}
|
||||
post3.PreSave()
|
||||
if !post3.IsUserActivitySystemMessage() {
|
||||
t.Fatalf("TestPostIsUserActivitySystemMessage failed, expected post3.IsSystemMessage() to be true")
|
||||
}
|
||||
|
||||
post4 := Post{Message: "test_4", Type: POST_LEAVE_CHANNEL}
|
||||
post4.PreSave()
|
||||
if !post4.IsUserActivitySystemMessage() {
|
||||
t.Fatalf("TestPostIsUserActivitySystemMessage failed, expected post4.IsSystemMessage() to be true")
|
||||
}
|
||||
|
||||
post5 := Post{Message: "test_5", Type: POST_ADD_REMOVE}
|
||||
post5.PreSave()
|
||||
if !post5.IsUserActivitySystemMessage() {
|
||||
t.Fatalf("TestPostIsUserActivitySystemMessage failed, expected post5.IsSystemMessage() to be true")
|
||||
}
|
||||
|
||||
post6 := Post{Message: "test_6", Type: POST_ADD_TO_CHANNEL}
|
||||
post6.PreSave()
|
||||
if !post6.IsUserActivitySystemMessage() {
|
||||
t.Fatalf("TestPostIsUserActivitySystemMessage failed, expected post6.IsSystemMessage() to be true")
|
||||
}
|
||||
|
||||
post7 := Post{Message: "test_7", Type: POST_REMOVE_FROM_CHANNEL}
|
||||
post7.PreSave()
|
||||
if !post7.IsUserActivitySystemMessage() {
|
||||
t.Fatalf("TestPostIsUserActivitySystemMessage failed, expected post7.IsSystemMessage() to be true")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user