fix: sync support private chat content protection
This commit is contained in:
parent
74c9249091
commit
037ce017d4
25 changed files with 1395 additions and 36 deletions
|
|
@ -1,7 +1,10 @@
|
|||
package rpc
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/iamxvbaba/td/tg"
|
||||
|
||||
"telesrv/internal/domain"
|
||||
)
|
||||
|
||||
|
|
@ -145,6 +148,25 @@ func tgMessageServiceAction(msg domain.Message) tg.MessageActionClass {
|
|||
return &tg.MessageActionSetChatTheme{
|
||||
Theme: &tg.ChatTheme{Emoticon: m.ServiceAction.ChatThemeEmoticon},
|
||||
}
|
||||
case domain.MessageServiceActionNoForwardsToggle:
|
||||
action := m.ServiceAction.NoForwards
|
||||
if action == nil {
|
||||
return &tg.MessageActionEmpty{}
|
||||
}
|
||||
return &tg.MessageActionNoForwardsToggle{
|
||||
PrevValue: action.PrevValue,
|
||||
NewValue: action.NewValue,
|
||||
}
|
||||
case domain.MessageServiceActionNoForwardsRequest:
|
||||
action := m.ServiceAction.NoForwards
|
||||
if action == nil {
|
||||
return &tg.MessageActionEmpty{}
|
||||
}
|
||||
return &tg.MessageActionNoForwardsRequest{
|
||||
Expired: action.Expired || (action.ExpiresAt > 0 && int(time.Now().Unix()) >= action.ExpiresAt),
|
||||
PrevValue: action.PrevValue,
|
||||
NewValue: action.NewValue,
|
||||
}
|
||||
case domain.MessageServiceActionPhoneCall:
|
||||
if m.ServiceAction.Call == nil {
|
||||
return &tg.MessageActionEmpty{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue