20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
...
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
...
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
|
'avoid', -- posts will be kept out of the timeline but will show on users' posts and in conversations
'exclude', -- own posts will not be visible to this user
};
credset = lib.set {
'pw', 'otp', 'challenge', 'trust'
};
privset = lib.set {
'post', 'edit', 'account', 'upload', 'moderate', 'admin', 'invite'
};
powerset = lib.set {
-- user powers -- default on
'login', -- not locked out
'visible', -- account & posts can be seen by others
'post', -- can do poasts
'shout', -- posts show up on local timeline
................................................................................
'invite' -- *unlimited* invites
};
prepmode = lib.enum {
'full','conf','admin'
}
}
m.privmap = {}
do local struct pt { name:lib.mem.ptr(int8), priv:m.powerset }
for k,v in pairs(m.powerset.members) do
m.privmap[#m.privmap + 1] = quote
var ps: m.powerset ps:clear()
(ps.[v] << true)
in pt {name = lib.str.plit(v), priv = ps} end
end end
terra m.powerset:affect_users()
return self.purge() or self.discipline() or self.herald() or
self.elevate() or self.demote() or self.cred()
end
local str = rawstring
................................................................................
actor_notice_enum: {&m.source, uint64} -> lib.mem.ptr(m.notice)
actor_rel_create: {&m.source, uint16, uint64, uint64} -> {}
actor_rel_destroy: {&m.source, uint16, uint64, uint64} -> {}
actor_rel_calc: {&m.source, uint64, uint64} -> m.relationship
auth_enum_uid: {&m.source, uint64} -> lib.mem.lstptr(m.auth)
auth_enum_handle: {&m.source, rawstring} -> lib.mem.lstptr(m.auth)
auth_attach_pw: {&m.source, uint64, bool, pstr, pstr} -> {}
auth_attach_key: {&m.source, uint64, bool, pstr, pstr} -> {}
-- uid: uint64
-- reset: bool (delete other passwords?)
-- pw: pstring
-- comment: pstring
auth_purge_pw: {&m.source, uint64, rawstring} -> {}
auth_purge_otp: {&m.source, uint64, rawstring} -> {}
auth_purge_trust: {&m.source, uint64, rawstring} -> {}
auth_sigtime_user_fetch: {&m.source, uint64} -> m.timepoint
-- authentication tokens and accounts have a property that controls
-- whether auth cookies dated to a certain point are valid. cookies
-- that are generated before the timepoint are considered invalid.
................................................................................
-- artifact id: uint64
-- detach: bool
post_retweet: {&m.source, uint64, uint64, bool} -> {}
post_like: {&m.source, uint64, uint64, bool} -> {}
-- undo: bool
post_react: {&m.source, uint64, uint64, pstring} -> {}
-- emoji: pstring (null to delete previous reaction, otherwise adds/changes)
post_liked_uid: {&m.source, uint64, uint64} -> bool
post_reacted_uid: {&m.source, uint64, uint64} -> bool
thread_latest_arrival_calc: {&m.source, uint64} -> m.timepoint
artifact_instantiate: {&m.source, lib.mem.ptr(uint8), lib.mem.ptr(int8)} -> uint64
-- instantiate an artifact in the database, either installing a new
-- artifact or returning the id of an existing artifact with the same hash
-- artifact: bytea
|
|
>
|
|
|
|
|
|
|
|
>
>
>
>
|
>
>
>
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
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
...
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
...
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
|
'avoid', -- posts will be kept out of the timeline but will show on users' posts and in conversations
'exclude', -- own posts will not be visible to this user
};
credset = lib.set {
'pw', 'otp', 'challenge', 'trust'
};
privset = lib.set {
'post', 'edit', 'account', 'upload', 'artifact', 'moderate', 'admin', 'invite'
};
powerset = lib.set {
-- user powers -- default on
'login', -- not locked out
'visible', -- account & posts can be seen by others
'post', -- can do poasts
'shout', -- posts show up on local timeline
................................................................................
'invite' -- *unlimited* invites
};
prepmode = lib.enum {
'full','conf','admin'
}
}
local function setmap(set)
local map = {}
local struct pt { name:lib.mem.ptr(int8), val:set }
for k,v in pairs(set.members) do
map[#map + 1] = quote
var ps: set ps:clear()
(ps.[v] << true)
in pt {name = lib.str.plit(v), val = ps} end
end
return map
end
m.powmap = setmap(m.powerset)
m.privmap = setmap(m.privset)
terra m.powerset:affect_users()
return self.purge() or self.discipline() or self.herald() or
self.elevate() or self.demote() or self.cred()
end
local str = rawstring
................................................................................
actor_notice_enum: {&m.source, uint64} -> lib.mem.ptr(m.notice)
actor_rel_create: {&m.source, uint16, uint64, uint64} -> {}
actor_rel_destroy: {&m.source, uint16, uint64, uint64} -> {}
actor_rel_calc: {&m.source, uint64, uint64} -> m.relationship
auth_enum_uid: {&m.source, uint64} -> lib.mem.lstptr(m.auth)
auth_enum_handle: {&m.source, rawstring} -> lib.mem.lstptr(m.auth)
auth_attach_pw: {&m.source, uint64, bool, pstr, pstr} -> uint64
auth_attach_key: {&m.source, uint64, bool, pstr, pstr} -> {}
-- uid: uint64
-- reset: bool (delete other passwords?)
-- pw: pstring
-- comment: pstring
auth_privs_set: {&m.source, uint64, m.privset} -> {}
auth_purge_pw: {&m.source, uint64, rawstring} -> {}
auth_purge_otp: {&m.source, uint64, rawstring} -> {}
auth_purge_trust: {&m.source, uint64, rawstring} -> {}
auth_sigtime_user_fetch: {&m.source, uint64} -> m.timepoint
-- authentication tokens and accounts have a property that controls
-- whether auth cookies dated to a certain point are valid. cookies
-- that are generated before the timepoint are considered invalid.
................................................................................
-- artifact id: uint64
-- detach: bool
post_retweet: {&m.source, uint64, uint64, bool} -> {}
post_like: {&m.source, uint64, uint64, bool} -> {}
-- undo: bool
post_react: {&m.source, uint64, uint64, pstring} -> {}
-- emoji: pstring (null to delete previous reaction, otherwise adds/changes)
post_act_cancel: {&m.source, uint64} -> {}
post_liked_uid: {&m.source, uint64, uint64} -> bool
post_reacted_uid: {&m.source, uint64, uint64} -> bool
post_act_fetch_notice: {&m.source, uint64} -> m.notice
thread_latest_arrival_calc: {&m.source, uint64} -> m.timepoint
artifact_instantiate: {&m.source, lib.mem.ptr(uint8), lib.mem.ptr(int8)} -> uint64
-- instantiate an artifact in the database, either installing a new
-- artifact or returning the id of an existing artifact with the same hash
-- artifact: bytea
|