forked from emersion/neutron
/
conversations.go
43 lines (38 loc) · 1.07 KB
/
conversations.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package backend
// Stores conversations data.
type ConversationsBackend interface {
MessagesBackend
// List all messages belonging to a conversation.
ListConversationMessages(user, id string) (msgs []*Message, err error)
// Get a specific conversation.
GetConversation(user, id string) (conv *Conversation, err error)
// List all user's conversations. A message filter can be provided.
ListConversations(user string, filter *MessagesFilter) ([]*Conversation, int, error)
// Count all user's conversations by label.
CountConversations(user string) ([]*MessagesCount, error)
// Permanently delete a conversation.
DeleteConversation(user, id string) error
}
// A conversation is a sequence of messages.
type Conversation struct {
ID string
Order int
Subject string
Senders []*Email
Recipients []*Email
NumMessages int
NumUnread int
NumAttachments int
ExpirationTime int
TotalSize int
Time int64
LabelIDs []string
Labels []*ConversationLabel
}
// Contains messages counts by labels.
type ConversationLabel struct {
ID string
Count int
NumMessages int
NumUnread int
}