Sanatize LastViewedAt and LastUpdateAt for other users on channel member object (#33835) (#33905)

Automatic Merge
Этот коммит содержится в:
Mattermost Build
2025-09-16 13:19:10 +03:00
коммит произвёл GitHub
родитель d41872f1f3
Коммит 98acefe911
5 изменённых файлов: 202 добавлений и 0 удалений

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

@@ -89,6 +89,17 @@ func (o *ChannelMember) Auditable() map[string]any {
}
}
// SanitizeForCurrentUser sanitizes channel member data based on whether
// it's the current user's own membership or another user's membership
func (o *ChannelMember) SanitizeForCurrentUser(currentUserId string) {
// If this is not the current user's own membership,
// sanitize sensitive timestamp fields
if o.UserId != currentUserId {
o.LastViewedAt = -1
o.LastUpdateAt = -1
}
}
// ChannelMemberWithTeamData contains ChannelMember appended with extra team information
// as well.
type ChannelMemberWithTeamData struct {