parsav  Diff

Differences From Artifact [da1c9184b0]:

To Artifact [6a465decce]:


     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   	notiftype = lib.enum {
     9         -		'mention', 'like', 'rt', 'react'
            9  +		'none', 'mention', 'like', 'rt', 'react'
    10     10   	};
    11     11   
    12     12   	relation = lib.set {
    13     13   		'silence', -- messages will not be accepted
    14     14   		'collapse', -- posts will be collapsed by default
    15     15   		'disemvowel', -- posts will be ritually humiliated, but shown
    16     16   		'avoid', -- posts will be kept out of the timeline but will show on users' posts and in conversations
................................................................................
    18     18   		'mute', -- posts will be completely hidden at all times
    19     19   		'block', -- no interactions will be permitted, but posts will remain visible
    20     20   	};
    21     21   	credset = lib.set {
    22     22   		'pw', 'otp', 'challenge', 'trust'
    23     23   	};
    24     24   	privset = lib.set {
    25         -		'post', 'edit', 'acct', 'upload', 'censor', 'admin', 'invite'
           25  +		'post', 'edit', 'account', 'upload', 'moderate', 'admin', 'invite'
    26     26   	};
    27     27   	powerset = lib.set {
    28     28   		-- user powers -- default on
    29     29   		'login', -- not locked out
    30     30   		'visible', -- account & posts can be seen by others
    31     31   		'post', -- can do poasts
    32     32   		'shout', -- posts show up on local timeline
    33     33   		'propagate', -- posts are sent to other instances
    34     34   		'artifact', -- upload, claim, and manage artifacts
    35         -		'acct', -- configure own account
           35  +		'account', -- configure own account
    36     36   		'edit'; -- edit own poasts
           37  +		'snitch'; -- can issue badthink reports
    37     38   
    38     39   		-- admin powers -- default off
    39     40   		'purge', -- permanently delete users
    40     41   		'config', -- change daemon policy & config UI
    41     42   		'censor', -- dispose of badthink
    42     43   		'discipline', -- enforced timeouts, stripping badges and epithets, punitive actions that do not permanently deprive of powers; can remove own injunctions but not others'
    43     44   		'vacate', -- can remove others' injunctions, but not apply them
    44     45   		'cred', -- alter credentials
    45     46   		'elevate', 'demote', -- change user rank, give and take powers, including the ability to log in
    46     47   		'rebrand', -- modify site's brand identity
    47     48   		'herald', -- grant serverwide epithets and badges
           49  +		'crier', -- can promote content to the instance page
    48     50   		'invite' -- *unlimited* invites
    49     51   	};
    50     52   	prepmode = lib.enum {
    51     53   		'full','conf','admin'
    52     54   	}
    53     55   }
    54     56   
................................................................................
    84     86   	var pow: m.powerset pow:clear()
    85     87   	(pow.login     << true)
    86     88   	(pow.visible   << true)
    87     89   	(pow.post      << true)
    88     90   	(pow.shout     << true)
    89     91   	(pow.propagate << true)
    90     92   	(pow.artifact  << true)
    91         -	(pow.acct      << true)
           93  +	(pow.account   << true)
    92     94   	(pow.edit      << true)
    93     95   	return m.rights { rank = 0, quota = 1000, invites = 0, powers = pow; }
    94     96   end
    95     97   
    96     98   struct m.actor {
    97     99   	id: uint64
    98    100   	nym: str
................................................................................
   212    214   	mentions: lib.mem.ptr(uint64)
   213    215   	circles: lib.mem.ptr(uint64) --only meaningful if scope is set to circle
   214    216   	convoheaduri: str
   215    217   	parent: uint64
   216    218   -- ephemera
   217    219   	localpost: bool
   218    220   	accent: int16
   219         -	depth: uint16 -- used in conversations to indicate tree depth
          221  +	rts: uint32
          222  +	likes: uint32
          223  +	rtdby: uint64 -- 0 if not rt
          224  +	rtact: uint64 -- 0 if not rt, id of rt action otherwise
   220    225   	source: &m.source
   221    226   
   222    227   	-- save :: bool -> {} (defined in acl.t due to dep. hell)
   223    228   }
   224    229   
   225    230   m.user_conf_funcs = function(be,n,ty,rty,rty2)
   226    231   	rty = rty or ty
................................................................................
   381    386   			-- origin: inet
   382    387   			-- cookie issue time: m.timepoint
   383    388   	actor_auth_register_uid: {&m.source, uint64, uint64} -> {}
   384    389   		-- notifies the backend module of the UID that has been assigned for
   385    390   		-- an authentication ID
   386    391   			-- aid: uint64
   387    392   			-- uid: uint64
          393  +	actor_notifs_fetch: {&m.source, uint64} -> lib.mem.lstptr(m.notif)
   388    394   
   389    395   	auth_enum_uid:    {&m.source, uint64}    -> lib.mem.lstptr(m.auth)
   390    396   	auth_enum_handle: {&m.source, rawstring} -> lib.mem.lstptr(m.auth)
   391    397   	auth_attach_pw: {&m.source, uint64, bool, pstr, pstr} -> {}
   392    398   		-- uid: uint64
   393    399   		-- reset: bool (delete other passwords?)
   394    400   		-- pw: pstring
................................................................................
   413    419   	post_enum_author_uid: {&m.source, uint64, m.range} -> lib.mem.lstptr(m.post)
   414    420   	post_enum_parent: {&m.source, uint64} -> lib.mem.lstptr(m.post)
   415    421   	post_attach_ctl: {&m.source, uint64, uint64, bool} -> {}
   416    422   		-- attaches or detaches an existing database artifact
   417    423   			-- post id: uint64
   418    424   			-- artifact id: uint64
   419    425   			-- detach: bool
          426  +	post_retweet: {&m.source, uint64, uint64, bool} -> {}
          427  +	post_like: {&m.source, uint64, uint64, bool} -> {}
          428  +			-- undo: bool
          429  +	post_react: {&m.source, uint64, uint64, pstring} -> {}
          430  +			-- emoji: pstring (null to delete previous reaction, otherwise adds/changes)
          431  +	post_liked_uid: {&m.source, uint64, uint64} -> bool
          432  +	post_reacted_uid: {&m.source, uint64, uint64} -> bool
   420    433   
   421    434   	thread_latest_arrival_calc: {&m.source, uint64} -> m.timepoint
   422    435   
   423    436   	artifact_instantiate: {&m.source, lib.mem.ptr(uint8), lib.mem.ptr(int8)} -> uint64
   424    437   		-- instantiate an artifact in the database, either installing a new
   425    438   		-- artifact or returning the id of an existing artifact with the same hash
   426    439   			-- artifact: bytea