Add GetConversations
This commit is contained in:
16
chat.go
16
chat.go
@ -421,6 +421,22 @@ func (k *Keybase) DeleteByConvID(convID chat1.ConvIDStr, msgID chat1.MessageID)
|
|||||||
return r, nil
|
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.
|
// ChatList returns a list of all conversations.
|
||||||
// You can pass a Channel to use as a filter here, but you'll probably want to
|
// You can pass a Channel to use as a filter here, but you'll probably want to
|
||||||
// leave the TopicName empty.
|
// leave the TopicName empty.
|
||||||
|
|||||||
1
types.go
1
types.go
@ -55,6 +55,7 @@ type SendMessageOptions struct {
|
|||||||
ConfirmLumenSend bool `json:"confirm_lumen_send"`
|
ConfirmLumenSend bool `json:"confirm_lumen_send"`
|
||||||
ReplyTo *chat1.MessageID `json:"reply_to,omitempty"`
|
ReplyTo *chat1.MessageID `json:"reply_to,omitempty"`
|
||||||
ExplodingLifetime *ExplodingLifetime `json:"exploding_lifetime,omitempty"`
|
ExplodingLifetime *ExplodingLifetime `json:"exploding_lifetime,omitempty"`
|
||||||
|
UnreadOnly bool `json:"unread_only,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type sendMessageParams struct {
|
type sendMessageParams struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user