summaryrefslogtreecommitdiffstats
path: root/store/sqlstore/channel_member_history_store.go
diff options
context:
space:
mode:
authorJonathan <jonfritz@gmail.com>2018-02-07 09:02:46 -0500
committerGitHub <noreply@github.com>2018-02-07 09:02:46 -0500
commitd3e934d07ac0a58a24a435ea7c5b3bd222ef509a (patch)
treeb356b134878ee8686326475b04c90317e195bf86 /store/sqlstore/channel_member_history_store.go
parentb2ee5077931013d308aaf60d790d341e2cb0c3e3 (diff)
downloadchat-d3e934d07ac0a58a24a435ea7c5b3bd222ef509a.tar.gz
chat-d3e934d07ac0a58a24a435ea7c5b3bd222ef509a.tar.bz2
chat-d3e934d07ac0a58a24a435ea7c5b3bd222ef509a.zip
XYZ-35: Added Support for GlobalRelay Compliance Export Format
* Added username to ChannelMemberHistory struct in anticipation of supporting GlobalRelay in Compliance Export * Removed translation from debug output - this makes it complicated to use utils functions from tests in the enterprise repo * Added an advanced email function that allows for greater control over message details. Updated MessageExport config to support GlobalRelay. Added attachment support to InBucket unit tests * Moving templates in from enterprise to solve test issues * Added export format to diagnostics * Changed email attachment code to use FileBackend so that S3 storage is properly supported
Diffstat (limited to 'store/sqlstore/channel_member_history_store.go')
-rw-r--r--store/sqlstore/channel_member_history_store.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/store/sqlstore/channel_member_history_store.go b/store/sqlstore/channel_member_history_store.go
index 182f37ce9..0b86aac28 100644
--- a/store/sqlstore/channel_member_history_store.go
+++ b/store/sqlstore/channel_member_history_store.go
@@ -110,7 +110,8 @@ func (s SqlChannelMemberHistoryStore) getFromChannelMemberHistoryTable(startTime
query := `
SELECT
cmh.*,
- u.Email
+ u.Email,
+ u.Username
FROM ChannelMemberHistory cmh
INNER JOIN Users u ON cmh.UserId = u.Id
WHERE cmh.ChannelId = :ChannelId
@@ -130,9 +131,10 @@ func (s SqlChannelMemberHistoryStore) getFromChannelMemberHistoryTable(startTime
func (s SqlChannelMemberHistoryStore) getFromChannelMembersTable(startTime int64, endTime int64, channelId string) ([]*model.ChannelMemberHistory, error) {
query := `
SELECT DISTINCT
- ch.ChannelId,
- ch.UserId,
- u.email
+ ch.ChannelId,
+ ch.UserId,
+ u.Email,
+ u.Username
FROM ChannelMembers AS ch
INNER JOIN Users AS u ON ch.UserId = u.id
WHERE ch.ChannelId = :ChannelId`
@@ -158,7 +160,7 @@ func (s SqlChannelMemberHistoryStore) PermanentDeleteBatch(endTime int64, limit
query =
`DELETE FROM ChannelMemberHistory
WHERE ctid IN (
- SELECT ctid FROM ChannelMemberHistory
+ SELECT ctid FROM ChannelMemberHistory
WHERE LeaveTime IS NOT NULL
AND LeaveTime <= :EndTime
LIMIT :Limit