/
user.avdl
264 lines (219 loc) · 6.73 KB
/
user.avdl
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
@namespace("keybase.1")
protocol user {
import idl "common.avdl";
record TrackProof {
string proofType;
string proofName;
string idString;
}
record WebProof {
string hostname;
array<string> protocols;
}
record Proofs {
array<TrackProof> social;
array<WebProof> web;
array<PublicKey> publicKeys;
}
record UserSummary {
UID uid;
string username;
string thumbnail;
int idVersion;
string fullName;
string bio;
Proofs proofs;
string sigIDDisplay;
Time trackTime;
}
@typedef("string")
record EmailAddress {}
record Email {
EmailAddress email;
boolean isVerified;
boolean isPrimary;
IdentityVisibility visibility;
UnixTime lastVerifyEmailDate;
}
record UserSettings {
array<Email> emails;
array<UserPhoneNumber> phoneNumbers;
}
/**
Load user summaries for the supplied uids.
They are "unchecked" in that the client is not verifying the info from the server.
If len(uids) > 500, the first 500 will be returned.
*/
array<UserSummary> loadUncheckedUserSummaries(int sessionID, array<UID> uids);
/**
Load a user from the server.
*/
User loadUser(int sessionID, UID uid);
User loadUserByName(int sessionID, string username);
/**
Load a user + device keys from the server.
*/
UserPlusKeys loadUserPlusKeys(int sessionID, UID uid, KID pollForKID);
UserPlusKeysV2AllIncarnations loadUserPlusKeysV2(
int sessionID,
UID uid,
KID pollForKID,
OfflineAvailability oa
);
/**
Load public keys for a user.
*/
array<PublicKey> loadPublicKeys(int sessionID, UID uid);
/**
Load my public keys (for logged in user).
*/
array<PublicKey> loadMyPublicKeys(int sessionID);
/**
Load user settings (for logged in user).
*/
UserSettings loadMySettings(int sessionID);
/**
The list-tracking functions get verified data from the tracking statements
in the user's sigchain.
If assertion is empty, it will use the current logged in user.
*/
array<UserSummary> listTracking(int sessionID, string filter, string assertion);
string listTrackingJSON(int sessionID, string filter, boolean verbose, string assertion);
/**
Load all the user's public keys (even those in reset key families)
from the server with no verification
*/
array<PublicKey> loadAllPublicKeysUnverified(int sessionID, UID uid);
record UserSummary2 {
UID uid;
string username;
string thumbnail;
string fullName;
boolean isFollower;
boolean isFollowee;
}
record UserSummary2Set {
array<UserSummary2> users;
Time time;
int version;
}
UserSummary2Set listTrackers2(int sessionID, string assertion, boolean reverse);
void profileEdit(int sessionID, string fullName, string location, string bio);
record InterestingPerson {
UID uid;
string username;
string fullname;
map<string, string> serviceMap;
}
array<InterestingPerson> interestingPeople(int maxUsers);
UserVersion meUserVersion(int sessionID, boolean forcePoll);
/**
getUPAK returns a UPAK. Used mainly for debugging.
*/
@lint("ignore")
UPAKVersioned getUPAK(UID uid);
/**
getUPAKLite returns a UPKLiteV1AllIncarnations. Used mainly for debugging.
*/
@lint("ignore")
UPKLiteV1AllIncarnations getUPAKLite(UID uid);
void uploadUserAvatar(string filename, union { null, ImageCropRect } crop);
ProofSuggestionsRes proofSuggestions(int sessionID);
record ProofSuggestionsRes{
array<ProofSuggestion> suggestions;
boolean showMore;
}
// A proof the user doesn't have.
record ProofSuggestion {
string key;
boolean belowFold;
string profileText; // "Prove your Twitter", "Add a PGP key"
array<SizedImage> profileIcon;
array<SizedImage> profileIconWhite;
string pickerText; // "Twitter", "Your own website", "octodon.xyz"
string pickerSubtext; // "twitter.com", "Mastodon instance"
array<SizedImage> pickerIcon;
array<Identify3RowMeta> metas; // for 'new' proof types
}
record NextMerkleRootRes {
union { null, MerkleRootV2 } res;
}
/**
FindNextMerkleRootAfterRevoke finds the first Merkle Root that contains the UID/KID
revocation at the given SigChainLocataion. The MerkleRootV2 prev is a hint as to where
we'll start our search. Usually it's the next one, but not always
*/
NextMerkleRootRes findNextMerkleRootAfterRevoke(UID uid, KID kid, SigChainLocation loc, MerkleRootV2 prev);
/**
FindNextMerkleRootAfterReset finds the first Merkle root that contains the UID reset
at resetSeqno. You should pass it prev, which was the last known Merkle root at the time of
the reset. Usually, we'll just turn up the next Merkle root, but not always.
*/
NextMerkleRootRes findNextMerkleRootAfterReset(UID uid, Seqno resetSeqno, ResetMerkleRoot prev);
/**
PassphraseState values are used in .config.json, so should not be changed without a migration strategy
*/
enum PassphraseState {
KNOWN_0,
RANDOM_1
}
record CanLogoutRes {
boolean canLogout;
string reason;
PassphraseState passphraseState;
}
CanLogoutRes canLogout(int sessionID);
PassphraseState loadPassphraseState(int sessionID);
union { null, UserCard } userCard(int sessionID, string username, boolean useSession);
// user.passphrase_state gregor message body
@lint("ignore")
record UserPassphraseStateMsg {
@jsonkey("state")
PassphraseState passphraseState;
}
record UserBlockedRow {
@jsonkey("block_uid")
UID uid;
@jsonkey("block_username")
string username;
@jsonkey("chat")
union { null, boolean } chat;
@jsonkey("follow")
union { null, boolean } follow;
}
// user.blocked gregor message body
record UserBlockedBody {
@jsonkey("blocks")
array<UserBlockedRow> blocks;
// The user who blocked (should be the currently logged-in user).
@jsonkey("blocker_uid")
UID uid;
@jsonkey("blocker_username")
string username;
}
record UserBlockedSummary {
string blocker;
array<string> blocked;
}
// User Blocking
record UserBlock {
string username;
boolean chatBlocked;
boolean followBlocked;
union { null, Time } createTime;
union { null, Time } modifyTime;
}
record UserBlockArg {
string username;
union { null, boolean } setChatBlock;
union { null, boolean } setFollowBlock;
}
void setUserBlocks(int sessionID, array<UserBlockArg> blocks);
array<UserBlock> getUserBlocks(int sessionID, array<string> usernames);
void reportUser(int sessionID, string username, string reason, string comment,
boolean includeTranscript, union { null, string } convID);
void dismissBlockButtons(TLFID tlfID);
// Legacy user blocking:
void blockUser(string username);
void unblockUser(string username);
}