Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ type Chat struct {
// Meeting duration
MeetingDuration int32 `json:"meeting_duration,omitempty"`

// Can I delete all messages history in this chat
CanDeleteGlobalHistory bool `json:"can_delete_global_history,omitempty"`

// Can I delete local messages history in this chat
CanDeleteLocalHistory bool `json:"can_delete_local_history,omitempty"`

// Parent message uid for thread
ParentMessageId string `json:"parent_message_id,omitempty"`

Expand Down
30 changes: 30 additions & 0 deletions server_chat_history_cleared.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package tdproto

// NewServerChatHistoryCleared returns the new ServerChatHistoryCleared instance.
func NewServerChatHistoryCleared(jid JID, lastCleared *string) (r ServerChatHistoryCleared) {
r.Name = r.GetName()
r.Params.JID = jid
if lastCleared != nil {
r.Params.LastClear = lastCleared
}

return r
}

// ServerChatHistoryCleared represents the event about clearing the chat messages history for user.
type ServerChatHistoryCleared struct {
BaseEvent
Params serverChatHistoryClearedParams `json:"params"`
}

// GetName returns the name of ServerChatHistoryCleared instance.
func (p ServerChatHistoryCleared) GetName() string { return "server.chat.history.cleared" }

// Params of the server.chat.history.cleared event
type serverChatHistoryClearedParams struct {
// Chat jid
JID JID `json:"jid"`

// LastClear last clear chat history
LastClear *string `json:"last_clear"`
}