Browse Source

Add GetConversations

main
Sam 4 years ago
parent
commit
c272c05092
  1. 16
      chat.go
  2. 1
      types.go

16
chat.go

@ -421,6 +421,22 @@ func (k *Keybase) DeleteByConvID(convID chat1.ConvIDStr, msgID chat1.MessageID) @@ -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.

1
types.go

@ -55,6 +55,7 @@ type SendMessageOptions struct { @@ -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 {

Loading…
Cancel
Save