forked from tulir/whatsmeow
-
Notifications
You must be signed in to change notification settings - Fork 1
/
call.go
57 lines (45 loc) · 1.48 KB
/
call.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
// Copyright (c) 2021 Tulir Asokan
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package events
import (
waBinary "github.com/LoL-Human/whatsmeow/binary"
"github.com/LoL-Human/whatsmeow/types"
)
// CallOffer is emitted when the user receives a call on WhatsApp.
type CallOffer struct {
types.BasicCallMeta
types.CallRemoteMeta
Data *waBinary.Node // The call offer data
}
// CallAccept is emitted when a call is accepted on WhatsApp.
type CallAccept struct {
types.BasicCallMeta
types.CallRemoteMeta
Data *waBinary.Node
}
// CallOfferNotice is emitted when the user receives a notice of a call on WhatsApp.
// This seems to be primarily for group calls (whereas CallOffer is for 1:1 calls).
type CallOfferNotice struct {
types.BasicCallMeta
Media string // "audio" or "video" depending on call type
Type string // "group" when it's a group call
Data *waBinary.Node
}
// CallRelayLatency is emitted slightly after the user receives a call on WhatsApp.
type CallRelayLatency struct {
types.BasicCallMeta
Data *waBinary.Node
}
// CallTerminate is emitted when the other party terminates a call on WhatsApp.
type CallTerminate struct {
types.BasicCallMeta
Reason string
Data *waBinary.Node
}
// UnknownCallEvent is emitted when a call element with unknown content is received.
type UnknownCallEvent struct {
Node *waBinary.Node
}