fix: sync latest channel and contact fixes

This commit is contained in:
A 2026-07-03 13:26:33 +08:00
parent e83650b9fd
commit 35e5d38f4d
11 changed files with 255 additions and 81 deletions

View file

@ -27,6 +27,16 @@ func (s *ChannelStore) ListChannelDifference(_ context.Context, req domain.Chann
if preview {
dialog = previewChannelDialog(req.UserID, channel, member)
}
if preview && member.Status != domain.ChannelMemberActive {
return domain.ChannelDifference{
Channel: channel,
Self: member,
Pts: channel.Pts,
Final: true,
Timeout: 30,
Dialog: dialog,
}, nil
}
if channel.Pts-req.Pts > limit {
messages := make([]domain.ChannelMessage, 0, domain.MaxChannelDifferenceTooLongMessages)
for i := len(s.messages[req.ChannelID]) - 1; i >= 0 && len(messages) < domain.MaxChannelDifferenceTooLongMessages; i-- {