-
Notifications
You must be signed in to change notification settings - Fork 1
/
chat.proto
113 lines (94 loc) · 2.73 KB
/
chat.proto
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
syntax = "proto3";
package pangea;
import "pangea.proto";
message DoubleRatchetMsg {
bytes doubleRatchetPK = 1;
uint32 n = 2;
uint32 pn = 3;
bytes cipherText = 4;
}
message PlainChatMessage {
message AddUserPrivGroupChat {
repeated bytes users = 1;
bytes chatID = 2;
string groupName = 3;
}
message RemoveUserPrivGroupChat {
repeated bytes user = 1;
bytes chatID = 2;
}
bytes dAppPublicKey = 1;
string type = 2;
bytes params = 3;
bytes message = 4;
int64 createdAt = 5;
string messageID = 6;
bytes sharedSecretBaseID = 7;
int64 sharedSecretCreationDate = 8;
uint32 version = 9;
AddUserPrivGroupChat addUserPrivChat = 10;
RemoveUserPrivGroupChat rmUserPrivChat = 11;
bytes GroupChatID = 12;
}
message ChatMessage {
bytes oneTimePreKey = 1;
bytes signedPreKey = 2;
bytes ephemeralKey = 3;
bytes ephemeralKeySignature = 4;
bytes senderChatIDKey = 5;
bytes senderChatIDKeySignature = 6;
DoubleRatchetMsg message = 7;
bytes receiver = 8;
bytes sender = 9;
bytes messageID = 10;
bytes usedSharedSecret = 11;
uint32 version = 12;
}
message PreKey {
bytes key = 1;
bytes identityKey = 2;
bytes identityKeySignature = 3;
int64 timeStamp = 4;
}
message MessageStateChange {
enum NewState {
SENT = 0;
DELIVERED = 1;
FAILED_TO_HANDLE = 2;
}
NewState newState = 1;
bytes messageID = 2;
bytes from = 3;
bytes fromSignature = 4;
}
message BackendMessage {
message Auth {
bytes toSign = 1;
bytes identityPublicKey = 2;
bytes signature = 3;
}
message Request {
repeated ChatMessage messages = 1;
MessageStateChange messageStateChange = 2;
bytes signedPreKey = 3;
uint32 newOneTimePreKeys = 4;
bytes preKeyBundle = 5;
Auth auth = 6;
PreKey newSignedPreKey = 7;
}
message Response {
PreKeyBundle preKeyBundle = 1;
repeated PreKey oneTimePrekeys = 2;
Auth auth = 3;
PreKey signedPreKey = 4;
}
message PreKeyBundle {
Profile profile = 1;
PreKey signedPreKey = 2;
PreKey oneTimePreKey = 3;
}
Request request = 1;
Response response = 2;
string error = 3;
string requestID = 4;
}