[MM-59519] preserve DM/GM unread/read state over export and import (#27707)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c2c37cea20
Коммит
4b3de1861f
@@ -4088,7 +4088,7 @@ func (s SqlChannelStore) GetAllDirectChannelsForExportAfter(limit int, afterId s
|
||||
channelIds = append(channelIds, channel.Id)
|
||||
}
|
||||
query = s.getQueryBuilder().
|
||||
Select("u.Username as Username, ChannelId, UserId, cm.Roles as Roles, LastViewedAt, MsgCount, MentionCount, MentionCountRoot, COALESCE(UrgentMentionCount, 0) UrgentMentionCount, cm.NotifyProps as NotifyProps, LastUpdateAt, SchemeUser, SchemeAdmin, (SchemeGuest IS NOT NULL AND SchemeGuest) as SchemeGuest").
|
||||
Select("u.Username as Username, ChannelId, UserId, cm.Roles as Roles, LastViewedAt, MsgCount, MsgCountRoot, MentionCount, MentionCountRoot, COALESCE(UrgentMentionCount, 0) UrgentMentionCount, cm.NotifyProps as NotifyProps, LastUpdateAt, SchemeUser, SchemeAdmin, (SchemeGuest IS NOT NULL AND SchemeGuest) as SchemeGuest").
|
||||
From("ChannelMembers cm").
|
||||
Join("Users u ON ( u.Id = cm.UserId )").
|
||||
Where(sq.Eq{"cm.ChannelId": channelIds})
|
||||
@@ -4106,12 +4106,11 @@ func (s SqlChannelStore) GetAllDirectChannelsForExportAfter(limit int, afterId s
|
||||
// Populate each channel with its members
|
||||
dmChannelsMap := make(map[string]*model.DirectChannelForExport)
|
||||
for _, channel := range directChannelsForExport {
|
||||
channel.Members = &[]string{}
|
||||
channel.Members = []*model.ChannelMemberForExport{}
|
||||
dmChannelsMap[channel.Id] = channel
|
||||
}
|
||||
for _, member := range channelMembers {
|
||||
members := dmChannelsMap[member.ChannelId].Members
|
||||
*members = append(*members, member.Username)
|
||||
dmChannelsMap[member.ChannelId].Members = append(dmChannelsMap[member.ChannelId].Members, member)
|
||||
}
|
||||
|
||||
return directChannelsForExport, nil
|
||||
|
||||
Ссылка в новой задаче
Block a user