Add GetConversations

This commit is contained in:
Sam
2020-02-16 23:21:20 -05:00
parent 67ffd89a00
commit c272c05092
2 changed files with 17 additions and 0 deletions

16
chat.go
View File

@ -421,6 +421,22 @@ func (k *Keybase) DeleteByConvID(convID chat1.ConvIDStr, msgID chat1.MessageID)
return r, nil
}
// GetConversations returns a list of all conversations. Optionally, you can filter by unread
func (k *Keybase) GetConversations(unreadOnly bool) (SendResponse, error) {
var r SendResponse
opts := SendMessageOptions{
UnreadOnly: unreadOnly,
}
r, err := k.SendMessage("list", opts)
if err != nil {
return r, err
}
return r, nil
}
// ChatList returns a list of all conversations.
// You can pass a Channel to use as a filter here, but you'll probably want to
// leave the TopicName empty.

View File

@ -55,6 +55,7 @@ type SendMessageOptions struct {
ConfirmLumenSend bool `json:"confirm_lumen_send"`
ReplyTo *chat1.MessageID `json:"reply_to,omitempty"`
ExplodingLifetime *ExplodingLifetime `json:"exploding_lifetime,omitempty"`
UnreadOnly bool `json:"unread_only,omitempty"`
}
type sendMessageParams struct {