fix: sync harden channel reads and suggested approvals
This commit is contained in:
parent
037ce017d4
commit
209a0d279b
14 changed files with 467 additions and 26 deletions
|
|
@ -58,6 +58,9 @@ func (r *Router) onChannelsReadHistory(ctx context.Context, req *tg.ChannelsRead
|
|||
if r.deps.Channels == nil {
|
||||
return true, nil
|
||||
}
|
||||
if req == nil {
|
||||
return false, inputRequestInvalidErr()
|
||||
}
|
||||
userID, _, err := r.currentUserID(ctx)
|
||||
if err != nil {
|
||||
return false, internalErr()
|
||||
|
|
@ -75,6 +78,9 @@ func (r *Router) onChannelsReadHistory(ctx context.Context, req *tg.ChannelsRead
|
|||
if err != nil {
|
||||
return false, channelInvalidErr(err)
|
||||
}
|
||||
if read.ReadOnly {
|
||||
return true, nil
|
||||
}
|
||||
if _, err := r.recordChannelReadInbox(ctx, userID, read); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue