parsav  Diff

Differences From Artifact [ac0f8e680f]:

To Artifact [77ab77b2db]:


    32     32   		subject = cs(lib.coalesce(p.subject,''));
    33     33   		nym = fullname;
    34     34   		when = cs(&timestr[0]);
    35     35   		avatar = cs(lib.trn(author.origin == 0, avistr.buf,
    36     36   			lib.coalesce(author.avatar, '/s/default-avatar.webp')));
    37     37   		acctlink = cs(author.xid);
    38     38   		permalink = permalink:finalize();
           39  +		attr = ''
    39     40   	}
           41  +
           42  +	var attrbuf: int8[32]
           43  +	if p.accent ~= -1 and p.accent ~= co.ui_hue then
           44  +		var hdecbuf: int8[21]
           45  +		var hdec = lib.math.decstr(p.accent, &hdecbuf[20])
           46  +		lib.str.cpy(&attrbuf[0], ' style="--hue:')
           47  +		lib.str.cpy(&attrbuf[14], hdec)
           48  +		var len = &hdecbuf[20] - hdec 
           49  +		lib.str.cpy(&attrbuf[14] + len, '"')
           50  +		tpl.attr = &attrbuf[0]
           51  +	end
           52  +
    40     53   	defer tpl.permalink:free()
    41     54   	if acc ~= nil then tpl:append(acc) return [lib.mem.ptr(int8)]{ptr=nil,ct=0} end
    42     55   	var txt = tpl:tostr()
    43     56   	return txt
    44     57   end
    45     58   return render_tweet