This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
/
events.go
61 lines (53 loc) · 2.05 KB
/
events.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// events.go - catshadow events
// Copyright (C) 2019 David Stainton.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package catshadow
import (
"time"
)
// KeyExchangeCompletedEvent is an event signaling the completion
// of a key exchange or failure if Err is non-nil.
type KeyExchangeCompletedEvent struct {
// Nickname is the nickname of the contact with whom our key
// exchange has been completed.
Nickname string
// Err is a key exchange error or is set to nil on success.
Err error
}
// MessageSentEvent is an event signaling that the message
// was sent.
type MessageSentEvent struct {
// Nickname is the nickname of the recipient of our delivered message.
Nickname string
// MessageID is the key in the conversation map referencing a specific message.
MessageID MessageID
}
// MessageDeliveredEvent is an event signaling that the message
// has been delivered to the remote spool.
type MessageDeliveredEvent struct {
// Nickname is the nickname of the recipient of our delivered message.
Nickname string
// MessageID is the key in the conversation map referencing a specific message.
MessageID MessageID
}
// MessageReceivedEvent is the event signaling that a message was received.
type MessageReceivedEvent struct {
// Nickname is the nickname from whom we received a message.
Nickname string
// Message is the message content which was received.
Message []byte
// Timestamp is the time the message was received.
Timestamp time.Time
}