-
Notifications
You must be signed in to change notification settings - Fork 2
/
notes.txt
175 lines (152 loc) · 3.94 KB
/
notes.txt
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
CHANGE FROM STORING BY USERNAME TO SOTRING BY USERID
types:
0 - normal
1 - error
codes (server --> client):
0 - new connection
op:
0: successful login
1: send confirmation code or error
type:
0 - success (conf code sent)
1 - email already exists
2 - username already exists
3? - need stronger password?
2: response to confirmation code input:
type:
0 - success (account created) -- note delete all user's conf codes here?
1 - failiure (incorrect code)
2 - failiure (code expired)
401: incorrect password
403: invalid session id
404: incorrect username
1 - resume session
op:
0: send everything except images
4 - socials
op:
0: recieve main socials data
1: recieve new friend request
2: friend request accepted
3: friend request rejected
4: cancel friend request
5: friend request submitted (response to client --> server {code: 4, op: 1})
6: respond to profile edit request,
7: remove friend/group DM
8: send friends
5 - message sent
6 - server
op:
0: create server response
1: view server page
2: view channel
3: recieve message
4: edit message
5: delete message
6: channel edited
7: channel deleted
// NOT DONE
8: server edited
9: server deleted
10: USER ACTION RESPONSE
actioncode:
0: kick
1: ban
2: unban
3: get all banned users
7 - encryption
op:
0: create new keys
10 - pong
codes (client --> server):
0 - new connection
op:
0: initial login request
1: account creation request
2: confirmation code submition
1 - resume session
op:
0: request everything except images
2 - logout
op:
0: all sessions
1: this session
3 - messages with a user
op:
0: get messages with a user
1: close DM
2: open DM
3: DM read
4 - socials
op:
0: get socials
1: send friend request
2: friend request accepted
3: friend request rejected
4: friend request cancelled
5: send profile edit request
6: remove friend
7: get friends
8: create group DM
9: remove from group DM (or delete if owner)
5 - message
op:
0: recieved
1: deleted
2: edited
6 - server
op:
0: create server
1: edit server
2: create channel
3: NOTHING I GUESS
4: get channel
5: send message
6: edit message
7: delete message
8: edit channel
9: delete channel
10: user action
actioncode:
0: kick
1: ban
2: unban
3: get all banned users
7 - security
op:
0: new keys created
10 - ping
DM FORMAT
DMs are stored in the format uid1|uid2 sorted by userID
- ex if uid1 = 02 and uid2 = 01 then the DM would be 01|02
USER
1 - stored in db labeled with uid
dm_keys:
uid: String
username: String
notetoself: Boolean
open: Boolean
sessions:
sid: String
2 - stored in db labeled "main" in a collection labeled "accounts"
username: String
Password: String
uid: String
sids: String[]
3 - things stored in db labeled "social" have the following vars
types:
0: open friend request
other (js object):
username: String
uid: String
USER NOTES:
when first creating a user, open a DM with the user to
itself with "notetoself = true";
GUILD ROLES:
{
id: string,
name: string,
pos: number,
color: string,
users: [{name: string, uid: string}],
}