parsav  Diff

Differences From Artifact [c997d2f5ad]:

To Artifact [0fea8fa8b6]:


    53     53   			($1).time,
    54     54   			($1).actor,
    55     55   			($1).subject,
    56     56   			null::bigint,
    57     57   			($1).body
    58     58   		)::pg_temp.parsavpg_intern_notice as notice
    59     59   	from (values
    60         -		('rt',    <notice:rt>   ),
    61         -		('like',  <notice:like> ),
    62         -		('react', <notice:react>)
           60  +		('rt',    <notice:rt>    ),
           61  +		('like',  <notice:like>  ),
           62  +		('react', <notice:react> ),
           63  +		('follow',<notice:follow>)
    63     64   	) as kmap(kstr,kind) where kmap.kstr = ($1).kind
    64     65   $$ language sql;
    65     66   
    66     67   create type pg_temp.parsavpg_intern_actor as (
    67     68   	id			bigint,
    68     69   	nym			text,
    69     70   	handle		text,
................................................................................
   208    209   				null::text
   209    210   			)::pg_temp.parsavpg_intern_notice as notice,
   210    211   			par.author as rcpt
   211    212   		from parsav_posts as p
   212    213   			inner join parsav_posts as par on p.parent = par.id
   213    214   			left  join ntimes as nt on nt.uid = p.author
   214    215   		where p.discovered >= coalesce(nt.when,0)
   215         -	), allnotices as (select * from acts union select * from replies)
          216  +	), follows as (
          217  +		select row(
          218  +				<notice:follow>::smallint,
          219  +				r.since,
          220  +				r.relator,
          221  +				r.relatee,
          222  +				null::bigint,
          223  +				null::text
          224  +			)::pg_temp.parsavpg_intern_notice as notice,
          225  +			r.relatee as rcpt
          226  +		from parsav_rels as r
          227  +			left  join ntimes as nt on nt.uid = r.relatee
          228  +		where
          229  +			r.since >= coalesce(nt.when,0) and
          230  +			r.kind = <rel:follow>
          231  +	), allnotices as (table acts union table replies union table follows)
   216    232   
   217    233   	table allnotices order by (notice).when desc
   218    234   );
   219    235