fix: sync protocol and discussion stability fixes
This commit is contained in:
parent
9f73dc20da
commit
aa21bd04e1
43 changed files with 7258 additions and 503 deletions
|
|
@ -206,7 +206,7 @@ func (r *Router) onChannelsGetParticipant(ctx context.Context, req *tg.ChannelsG
|
|||
}
|
||||
member, err := r.deps.Channels.GetParticipant(ctx, userID, channelID, peer.ID)
|
||||
if err != nil {
|
||||
return nil, channelInvalidErr(err)
|
||||
return nil, channelParticipantErr(err)
|
||||
}
|
||||
participant := tgChannelParticipant(userID, member)
|
||||
users := r.tgUsersForIDs(ctx, userID, channelParticipantUserRefs(participant))
|
||||
|
|
@ -217,6 +217,13 @@ func (r *Router) onChannelsGetParticipant(ctx context.Context, req *tg.ChannelsG
|
|||
}, nil
|
||||
}
|
||||
|
||||
func channelParticipantErr(err error) error {
|
||||
if errors.Is(err, domain.ErrUserNotParticipant) {
|
||||
return tgerr400("USER_NOT_PARTICIPANT")
|
||||
}
|
||||
return channelInvalidErr(err)
|
||||
}
|
||||
|
||||
func channelParticipantUserRefs(participant tg.ChannelParticipantClass) []int64 {
|
||||
ids := make([]int64, 0, 3)
|
||||
add := func(id int64) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue