fix(messages): sync preserve private dialogs after clearing history
This commit is contained in:
parent
3926db7762
commit
e22fac1c3f
19 changed files with 923 additions and 231 deletions
30
internal/rpc/convert_history_clear_test.go
Normal file
30
internal/rpc/convert_history_clear_test.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package rpc
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/iamxvbaba/td/tg"
|
||||
|
||||
"telesrv/internal/domain"
|
||||
)
|
||||
|
||||
func TestTGMessageProjectsHistoryClearServiceAction(t *testing.T) {
|
||||
message := domain.NewHistoryClearMessage(
|
||||
1001,
|
||||
domain.Peer{Type: domain.PeerTypeUser, ID: 1002},
|
||||
77,
|
||||
88,
|
||||
1700000000,
|
||||
9,
|
||||
)
|
||||
got, ok := tgMessage(message).(*tg.MessageService)
|
||||
if !ok {
|
||||
t.Fatalf("message = %T, want *tg.MessageService", tgMessage(message))
|
||||
}
|
||||
if got.ID != 77 || !got.Out || got.PeerID == nil || got.FromID == nil {
|
||||
t.Fatalf("service message = %+v, want owner-local id/peer/from", got)
|
||||
}
|
||||
if _, ok := got.Action.(*tg.MessageActionHistoryClear); !ok {
|
||||
t.Fatalf("action = %T, want *tg.MessageActionHistoryClear", got.Action)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue