parsav  Diff

Differences From Artifact [74775ce158]:

To Artifact [ea921b8ffe]:


     1      1   -- vim: ft=terra
     2      2   local pstr = lib.str.t
     3      3   local terra cs(s: rawstring)
     4      4   	return pstr { ptr = s, ct = lib.str.sz(s) }
     5      5   end
     6      6   
     7      7   local terra 
     8         -render_nym(who: &lib.store.actor, scope: uint64, tgt: &lib.str.acc)
            8  +render_nym(who: &lib.store.actor, scope: uint64, tgt: &lib.str.acc, minimal: bool)
     9      9   	var acc: lib.str.acc
    10     10   	var n: &lib.str.acc
    11     11   	if tgt ~= nil then n = tgt else
    12     12   		n = &acc
    13     13   		n:init(128)
    14     14   	end
    15     15   	var xidsan = lib.html.sanitize(cs(who.xid),false)
................................................................................
    18     18   		n:lpush('<span class="nym">'):ppush(nymsan)
    19     19   			:lpush('</span> [<span class="handle">'):ppush(xidsan)
    20     20   			:lpush('</span>]')
    21     21   		nymsan:free()
    22     22   	else n:lpush('<span class="handle">'):ppush(xidsan):lpush('</span>') end
    23     23   	xidsan:free()
    24     24   
    25         -	if who.epithet ~= nil then
    26         -		var episan = lib.html.sanitize(cs(who.epithet),false)
    27         -		n:lpush('<span class="epithet">'):ppush(episan):lpush('</span>')
    28         -		episan:free()
           25  +	if not minimal then
           26  +		if who.epithet ~= nil then
           27  +			var episan = lib.html.sanitize(cs(who.epithet),false)
           28  +			n:lpush('<span class="epithet">'):ppush(episan):lpush('</span>')
           29  +			episan:free()
           30  +		end
    29     31   	end
    30     32   	
    31     33   	-- TODO: if scope == chat room then lookup titles in room member db
    32     34   	if tgt == nil then
    33     35   		return n:finalize()
    34     36   	else return pstr.null() end
    35     37   end
    36     38   
    37     39   return render_nym