gmessages/libgm/events/typing.go
Tulir Asokan 1615e146b6 Update library
Co-authored-by: zero <108243503+0xzer@users.noreply.github.com>
2023-07-09 14:49:55 +03:00

50 lines
903 B
Go

package events
import "go.mau.fi/mautrix-gmessages/libgm/binary"
type TypingEvent interface {
GetConversation() string
}
type User struct {
Field1 int64
Number string
}
type STARTED_TYPING struct {
ConversationId string
User User
}
func (t *STARTED_TYPING) GetConversation() string {
return t.ConversationId
}
func NewStartedTyping(data *binary.TypingData) TypingEvent {
return &STARTED_TYPING{
ConversationId: data.ConversationID,
User: User{
Field1: data.User.Field1,
Number: data.User.Number,
},
}
}
type STOPPED_TYPING struct {
ConversationId string
User User
}
func (t *STOPPED_TYPING) GetConversation() string {
return t.ConversationId
}
func NewStoppedTyping(data *binary.TypingData) TypingEvent {
return &STOPPED_TYPING{
ConversationId: data.ConversationID,
User: User{
Field1: data.User.Field1,
Number: data.User.Number,
},
}
}