Differences From
Artifact [bb9260aa8d]:
2 2 local m = {
3 3 timepoint = lib.osclock.time_t;
4 4 scope = lib.enum {
5 5 'public', 'private', 'local';
6 6 'personal', 'direct', 'circle';
7 7 };
8 8 noticetype = lib.enum {
9 - 'none', 'mention', 'reply', 'like', 'rt', 'react', 'follow'
9 + -- only add new values to the end of this list! the numerical value
10 + -- is stored in the database and must be kept synchronized across versions
11 + 'none', 'mention', 'reply', 'like', 'rt', 'react', 'follow', 'followreq'
10 12 };
11 13
12 14 relation = lib.set {
13 15 'follow',
14 - 'subscribe', -- get a notification for every post
16 + 'sub', -- get a notification for every post
15 17 'mute', -- posts will be completely hidden at all times
16 18 'block', -- no interactions will be permitted, but posts will remain visible
17 19 'silence', -- messages will not be accepted
18 20 'collapse', -- posts will be collapsed by default
19 21 'disemvowel', -- posts will be ritually humiliated, but shown
20 22 'avoid', -- posts will be kept out of the timeline but will show on users' posts and in conversations
21 23 'exclude', -- own posts will not be visible to this user
................................................................................
98 100 (pow.propagate << true)
99 101 (pow.artifact << true)
100 102 (pow.account << true)
101 103 (pow.edit << true)
102 104 (pow.snitch << true)
103 105 return m.rights { rank = 0, quota = 1000, invites = 0, powers = pow; }
104 106 end
107 +
108 +struct m.relationship {
109 + agent: uint64
110 + patient: uint64
111 + rel: m.relation -- agent → patient
112 + recip: m.relation -- patient → agent
113 +}
105 114
106 115 struct m.actor {
107 116 id: uint64
108 117 nym: str
109 118 handle: str
110 119 origin: uint64
111 120 bio: str
................................................................................
115 124 knownsince: m.timepoint
116 125 rights: m.rights
117 126 key: lib.mem.ptr(uint8)
118 127
119 128 -- ephemera
120 129 xid: str
121 130 source: &m.source
131 + relationship: m.relationship -- relationship to the logged-in user, if any
122 132 }
123 133
124 134 terra m.actor:outranks(other: &m.actor)
125 135 -- this predicate determines where two users stand relative to
126 136 -- each other in the formal staff hierarchy. it is used in
127 137 -- authority calculations, but this function should only be
128 138 -- used directly in rendering code and by other predicates.
................................................................................
330 340 aname: str
331 341 comment: str
332 342 netmask: m.inet
333 343 privs: m.privset
334 344 blacklist: bool
335 345 }
336 346
337 -struct m.relationship {
338 - agent: uint64
339 - patient: uint64
340 - rel: m.relation -- agent → patient
341 - recip: m.relation -- patient → agent
342 -}
343 -
344 347 -- backends only handle content on the local server
345 348 struct m.backend { id: rawstring
346 349 open: &m.source -> &opaque
347 350 close: &m.source -> {}
348 351 dbsetup: &m.source -> bool -- creates the schema needed to call conprep (called only once per database e.g. with `parsav db init`)
349 352 conprep: {&m.source, m.prepmode.t} -> {} -- prepares queries and similar tasks that require the schema to already be in place
350 353 obliterate_everything: &m.source -> bool -- wipes everything parsav-related out of the database