From d448a6bef30339a63b7c118b8b2deb44cdb79d8e Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 7 Mar 2018 10:54:51 -0500 Subject: XYZ-87: GlobalRelay DM Exports do not Include Channel Name (#8275) * Adding ChannelMemberHistory table records when DM channels are created. This ensures that both participants in a DM are shown in compliance export, even if only one of them typed anything * Direct/Group Message channels now get pretty display names for the purpose of compliance exports * Fixed string formatting in t.Fatal calls * Changed uses of ChannelMemberHistory over to ChannelMemberHistoryResult in tests. This should have been done as a part of the work in XYZ-110, but seems to have been missed in this branch for some reason --- store/sqlstore/compliance_store.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'store/sqlstore/compliance_store.go') diff --git a/store/sqlstore/compliance_store.go b/store/sqlstore/compliance_store.go index 03d92d5e1..121d80102 100644 --- a/store/sqlstore/compliance_store.go +++ b/store/sqlstore/compliance_store.go @@ -223,7 +223,11 @@ func (s SqlComplianceStore) MessageExport(after int64, limit int) store.StoreCha Posts.Type AS PostType, Posts.FileIds AS PostFileIds, Channels.Id AS ChannelId, - Channels.DisplayName AS ChannelDisplayName, + CASE + WHEN Channels.Type = 'D' THEN 'Direct Message' + WHEN Channels.Type = 'G' THEN 'Group Message' + ELSE Channels.DisplayName + END AS ChannelDisplayName, Users.Id AS UserId, Users.Email AS UserEmail, Users.Username -- cgit v1.2.3-1-g7c22 From 426796829a4a1436c4733ee856d033c02749e64b Mon Sep 17 00:00:00 2001 From: Martin Kraft Date: Fri, 9 Mar 2018 10:30:05 -0500 Subject: MM-8839: Adds ChannelType to compliance-related model. (#8424) --- store/sqlstore/compliance_store.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'store/sqlstore/compliance_store.go') 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 -- cgit v1.2.3-1-g7c22