merged from gramsrv upstream
This commit is contained in:
parent
79c64ee916
commit
21a0856587
651 changed files with 54774 additions and 4590 deletions
|
|
@ -2,10 +2,12 @@ package rpc
|
|||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
"telesrv/internal/domain"
|
||||
)
|
||||
|
||||
type captureDialogs struct {
|
||||
mu sync.Mutex
|
||||
list domain.DialogList
|
||||
pinnedList domain.DialogList
|
||||
hasPinnedList bool
|
||||
|
|
@ -31,9 +33,20 @@ type captureDialogs struct {
|
|||
peer domain.Peer
|
||||
topMessageID int
|
||||
}
|
||||
invalidatedDialogs []struct {
|
||||
userID int64
|
||||
peer domain.Peer
|
||||
}
|
||||
reorderNoChange bool
|
||||
}
|
||||
|
||||
func (s *captureDialogs) InvalidateDialog(userID int64, peer domain.Peer) {
|
||||
s.invalidatedDialogs = append(s.invalidatedDialogs, struct {
|
||||
userID int64
|
||||
peer domain.Peer
|
||||
}{userID: userID, peer: peer})
|
||||
}
|
||||
|
||||
func (s *captureDialogs) GetDialogsHash(_ context.Context, _ int64, filter domain.DialogFilter) (domain.DialogHashCheck, error) {
|
||||
s.hashCalls++
|
||||
s.hashFilter = filter
|
||||
|
|
@ -41,6 +54,8 @@ func (s *captureDialogs) GetDialogsHash(_ context.Context, _ int64, filter domai
|
|||
}
|
||||
|
||||
func (s *captureDialogs) GetDialogs(_ context.Context, _ int64, filter domain.DialogFilter) (domain.DialogList, error) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.getDialogsCalls++
|
||||
s.filter = filter
|
||||
s.filters = append(s.filters, filter)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue