MM-14721 - Add an identifier for compliance exports when a message is posted by a bot account (#10908)

Этот коммит содержится в:
Eli Yukelzon
2019-05-23 13:33:18 +03:00
коммит произвёл GitHub
родитель a8caee330a
Коммит e59674cfdd
6 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@@ -12,4 +12,5 @@ type ChannelMemberHistoryResult struct {
// these two fields are never set in the database - when we SELECT, we join on Users to get them
UserEmail string `db:"Email"`
Username string
IsBot bool
}

Просмотреть файл

@@ -16,6 +16,7 @@ type MessageExport struct {
UserId *string
UserEmail *string
Username *string
IsBot bool
PostId *string
PostCreateAt *int64

Просмотреть файл

@@ -112,9 +112,11 @@ func (s SqlChannelMemberHistoryStore) getFromChannelMemberHistoryTable(startTime
SELECT
cmh.*,
u.Email,
u.Username
u.Username,
Bots.UserId IS NOT NULL AS IsBot
FROM ChannelMemberHistory cmh
INNER JOIN Users u ON cmh.UserId = u.Id
LEFT JOIN Bots ON Bots.UserId = u.Id
WHERE cmh.ChannelId = :ChannelId
AND cmh.JoinTime <= :EndTime
AND (cmh.LeaveTime IS NULL OR cmh.LeaveTime >= :StartTime)
@@ -135,9 +137,12 @@ func (s SqlChannelMemberHistoryStore) getFromChannelMembersTable(startTime int64
ch.ChannelId,
ch.UserId,
u.Email,
u.Username
u.Username,
Bots.UserId IS NOT NULL AS IsBot
FROM ChannelMembers AS ch
INNER JOIN Users AS u ON ch.UserId = u.id
LEFT JOIN Bots ON Bots.UserId = u.Id
WHERE ch.ChannelId = :ChannelId`
params := map[string]interface{}{"ChannelId": channelId}

Просмотреть файл

@@ -71,6 +71,7 @@
<table class="participants">
<tr>
<th class="username">Username<br></th>
<th class="usertype">UserType<br></th>
<th class="email">Email</th>
<th class="joined">Joined</th>
<th class="left">Left</th>

Просмотреть файл

@@ -2,6 +2,7 @@
<li class="message">
<span class="sent_time">{{.Props.SentTime}}</span>
<span class="username">@{{.Props.Username}}</span>
<span class="usertype">{{.Props.UserType}}</span>
<span class="email">({{.Props.Email}}):</span>
<span class="message">{{.Props.Message}}</span>
</li>

Просмотреть файл

@@ -1,6 +1,7 @@
{{define "globalrelay_compliance_export_participant_row"}}
<tr>
<td class="username">@{{.Props.Username}}</td>
<td class="usertype">{{.Props.UserType}}</td>
<td class="email">{{.Props.Email}}</td>
<td class="joined">{{.Props.Joined}}</td>
<td class="left">{{.Props.Left}}</td>