63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
s:lpush('<div class="stats">')
if p.rts > 0 then s:lpush('<div class="rt">' ):ipush(p.rts ):lpush('</div>') end
if p.likes > 0 then s:lpush('<div class="like">'):ipush(p.likes):lpush('</div>') end
s:lpush('</div>')
tpl.stats = s:finalize()
end
var attrbuf: int8[32]
if p.accent ~= -1 and p.accent ~= co.ui_hue then
var hdecbuf: int8[21]
var hdec = lib.math.decstr(p.accent, &hdecbuf[20])
lib.str.cpy(&attrbuf[0], ' style="--hue:')
lib.str.cpy(&attrbuf[14], hdec)
var len = &hdecbuf[20] - hdec
lib.str.cpy(&attrbuf[14] + len, '"')
tpl.attr = &attrbuf[0]
end
defer tpl.permalink:free()
if acc ~= nil then
if retweeter ~= nil then push_promo_header(co, acc, retweeter, p.rtact) end
tpl:append(acc)
if retweeter ~= nil then acc:lpush('</div>') end
if p.rts + p.likes > 0 then tpl.stats:free() end
|
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
s:lpush('<div class="stats">')
if p.rts > 0 then s:lpush('<div class="rt">' ):ipush(p.rts ):lpush('</div>') end
if p.likes > 0 then s:lpush('<div class="like">'):ipush(p.likes):lpush('</div>') end
s:lpush('</div>')
tpl.stats = s:finalize()
end
var attrbuf: int8[48]
var attrcur = &attrbuf[0]
if p.accent ~= -1 and p.accent ~= co.ui_hue then
var hdecbuf: int8[21]
var hdec = lib.math.decstr(p.accent, &hdecbuf[20])
attrcur = lib.str.cpy(attrcur,' style="--hue:')
attrcur = lib.str.cpy(attrcur, hdec)
-- var len = &hdecbuf[20] - hdec
attrcur = lib.str.cpy(attrcur, '"')
end
if p.author == co.who.id then attrcur = lib.str.cpy(attrcur, ' data-own') end
if attrcur ~= &attrbuf[0] then tpl.attr = &attrbuf[0] end
defer tpl.permalink:free()
if acc ~= nil then
if retweeter ~= nil then push_promo_header(co, acc, retweeter, p.rtact) end
tpl:append(acc)
if retweeter ~= nil then acc:lpush('</div>') end
if p.rts + p.likes > 0 then tpl.stats:free() end
|