-
Notifications
You must be signed in to change notification settings - Fork 5
/
chat.go
53 lines (43 loc) · 1.08 KB
/
chat.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
// Copyright (c) 2017-2019 AccelByte Inc. All Rights Reserved.
// This is licensed software from AccelByte Inc, for limitations
// and restrictions contact your company contract manager.
package model
type Chat interface {
Len() int
}
// ChatMessage contains user's chat
type ChatMessage struct {
ID string
From string
To string
Payload string
ReceivedAt int64
}
// PersonalChatRequest contains user's personal chat
type PersonalChatRequest struct {
*ChatMessage
}
// Len implements Chat interface
func (c PersonalChatRequest) Len() int {
return len(c.Payload)
}
// PersonalChatNotif is the notif message for incoming chat message
type PersonalChatNotif struct {
*ChatMessage
}
// PartyChatRequest contains user's party chat
type PartyChatRequest struct {
*ChatMessage
}
// Len implements Chat interface
func (c PartyChatRequest) Len() int {
return len(c.Payload)
}
// PartyChatNotif contains user's party chat
type PartyChatNotif struct {
*ChatMessage
}
// Len implements Chat interface
func (c SendChannelChatRequest) Len() int {
return len(c.Payload)
}