Browse Source

Add Mark method to Chat

main
Sam 5 years ago
parent
commit
3b0984102c
  1. 16
      chat.go
  2. 1
      types.go

16
chat.go

@ -363,3 +363,19 @@ func (c Chat) Unpin() (ChatAPI, error) { @@ -363,3 +363,19 @@ func (c Chat) Unpin() (ChatAPI, error) {
}
return r, nil
}
// Mark marks a conversation as read up to a specified message
func (c Chat) Mark(messageID int) (ChatAPI, error) {
m := ChatAPI{
Params: &params{},
}
m.Method = "mark"
m.Params.Options.Channel = c.Channel
m.Params.Options.MessageID = messageID
r, err := chatAPIOut(c.keybase, m)
if err != nil {
return ChatAPI{}, err
}
return r, nil
}

1
types.go

@ -470,6 +470,7 @@ type chat interface { @@ -470,6 +470,7 @@ type chat interface {
LoadFlip(messageID int, conversationID string, flipConversationID string, gameID string) (ChatAPI, error)
Pin(messageID int) (ChatAPI, error)
Unpin() (ChatAPI, error)
Mark(messageID int) (ChatAPI, error)
}
type chatAPI interface {

Loading…
Cancel
Save