Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12041 add chat message history #149

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
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"`
}