diff options
author | Martin Kraft <mkraft@users.noreply.github.com> | 2018-03-09 10:30:05 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2018-03-09 10:30:05 -0500 |
commit | 426796829a4a1436c4733ee856d033c02749e64b (patch) | |
tree | 21076940dc50994670aca2af9724c89c43de27a8 | |
parent | 8ad99b4b1fbc901a69886d9a12ac016d8396b32f (diff) | |
download | chat-426796829a4a1436c4733ee856d033c02749e64b.tar.gz chat-426796829a4a1436c4733ee856d033c02749e64b.tar.bz2 chat-426796829a4a1436c4733ee856d033c02749e64b.zip |
MM-8839: Adds ChannelType to compliance-related model. (#8424)
-rw-r--r-- | model/compliance_post.go | 3 | ||||
-rw-r--r-- | model/message_export.go | 1 | ||||
-rw-r--r-- | store/sqlstore/compliance_store.go | 3 | ||||
-rw-r--r-- | store/storetest/compliance_store.go | 2 |
4 files changed, 9 insertions, 0 deletions
diff --git a/model/compliance_post.go b/model/compliance_post.go index 3751c5862..75e8de1f1 100644 --- a/model/compliance_post.go +++ b/model/compliance_post.go @@ -17,6 +17,7 @@ type CompliancePost struct { // From Channel ChannelName string ChannelDisplayName string + ChannelType string // From User UserUsername string @@ -45,6 +46,7 @@ func CompliancePostHeader() []string { "ChannelName", "ChannelDisplayName", + "ChannelType", "UserUsername", "UserEmail", @@ -92,6 +94,7 @@ func (me *CompliancePost) Row() []string { cleanComplianceStrings(me.ChannelName), cleanComplianceStrings(me.ChannelDisplayName), + cleanComplianceStrings(me.ChannelType), cleanComplianceStrings(me.UserUsername), cleanComplianceStrings(me.UserEmail), diff --git a/model/message_export.go b/model/message_export.go index 22641deee..6efb8c6a4 100644 --- a/model/message_export.go +++ b/model/message_export.go @@ -6,6 +6,7 @@ package model type MessageExport struct { ChannelId *string ChannelDisplayName *string + ChannelType *string UserId *string UserEmail *string diff --git a/store/sqlstore/compliance_store.go b/store/sqlstore/compliance_store.go index 121d80102..c3c75581e 100644 --- a/store/sqlstore/compliance_store.go +++ b/store/sqlstore/compliance_store.go @@ -138,6 +138,7 @@ func (s SqlComplianceStore) ComplianceExport(job *model.Compliance) store.StoreC Teams.DisplayName AS TeamDisplayName, Channels.Name AS ChannelName, Channels.DisplayName AS ChannelDisplayName, + Channels.Type AS ChannelType, Users.Username AS UserUsername, Users.Email AS UserEmail, Users.Nickname AS UserNickname, @@ -172,6 +173,7 @@ func (s SqlComplianceStore) ComplianceExport(job *model.Compliance) store.StoreC 'Direct Messages' AS TeamDisplayName, Channels.Name AS ChannelName, Channels.DisplayName AS ChannelDisplayName, + Channels.Type AS ChannelType, Users.Username AS UserUsername, Users.Email AS UserEmail, Users.Nickname AS UserNickname, @@ -228,6 +230,7 @@ func (s SqlComplianceStore) MessageExport(after int64, limit int) store.StoreCha WHEN Channels.Type = 'G' THEN 'Group Message' ELSE Channels.DisplayName END AS ChannelDisplayName, + Channels.Type AS ChannelType, Users.Id AS UserId, Users.Email AS UserEmail, Users.Username diff --git a/store/storetest/compliance_store.go b/store/storetest/compliance_store.go index 0a6b79cc5..50a62531f 100644 --- a/store/storetest/compliance_store.go +++ b/store/storetest/compliance_store.go @@ -509,6 +509,7 @@ func testMessageExportPrivateChannel(t *testing.T, ss store.Store) { assert.Equal(t, post1.Message, *messageExportMap[post1.Id].PostMessage) assert.Equal(t, channel.Id, *messageExportMap[post1.Id].ChannelId) assert.Equal(t, channel.DisplayName, *messageExportMap[post1.Id].ChannelDisplayName) + assert.Equal(t, channel.Type, *messageExportMap[post1.Id].ChannelType) assert.Equal(t, user1.Id, *messageExportMap[post1.Id].UserId) assert.Equal(t, user1.Email, *messageExportMap[post1.Id].UserEmail) assert.Equal(t, user1.Username, *messageExportMap[post1.Id].Username) @@ -519,6 +520,7 @@ func testMessageExportPrivateChannel(t *testing.T, ss store.Store) { assert.Equal(t, post2.Message, *messageExportMap[post2.Id].PostMessage) assert.Equal(t, channel.Id, *messageExportMap[post2.Id].ChannelId) assert.Equal(t, channel.DisplayName, *messageExportMap[post2.Id].ChannelDisplayName) + assert.Equal(t, channel.Type, *messageExportMap[post2.Id].ChannelType) assert.Equal(t, user1.Id, *messageExportMap[post2.Id].UserId) assert.Equal(t, user1.Email, *messageExportMap[post2.Id].UserEmail) assert.Equal(t, user1.Username, *messageExportMap[post2.Id].Username) |