13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
acc:lpush('</a> retweeted</div>')
if co.aid ~= 0 and co.who.id == rter.id then
acc:lpush('<a href="/post/'):shpush(rid):lpush('/del" class="del">✖</a>')
end
end
local terra
render_tweet(co: &lib.srv.convo, p: &lib.store.post, acc: &lib.str.acc)
var author: &lib.store.actor = nil
var retweeter: &lib.store.actor = nil
for j = 0, co.actorcache.top do
if p.author == co.actorcache(j).ptr.id then author = co.actorcache(j).ptr end
if p.rtdby == co.actorcache(j).ptr.id then retweeter = co.actorcache(j).ptr end
if author ~= nil and (p.rtdby == 0 or retweeter ~= nil) then
goto foundauth
................................................................................
author = co.actorcache:insert(co:uid2actor_live(p.author)).ptr
end
if p.rtdby ~= 0 and retweeter == nil then
retweeter = co.actorcache:insert(co:uid2actor_live(p.rtdby)).ptr
end
::foundauth::
var timestr: int8[26] lib.osclock.ctime_r(&p.posted, ×tr[0])
for i=0,26 do if timestr[i] == @'\n' then timestr[i] = 0 break end end -- 🙄
var bhtml = lib.smackdown.html(&co.srv.pool, [lib.mem.ptr(int8)] {ptr=p.body,ct=0},false)
--defer bhtml:free()
var idbuf: int8[lib.math.shorthand.maxlen]
var idlen = lib.math.shorthand.gen(p.id, idbuf)
var permalink: lib.str.acc permalink:pool(&co.srv.pool, 7+idlen):lpush('/post/'):push(idbuf,idlen)
var fullname = lib.render.nym(author,0,nil, false) defer fullname:free()
var tpl = data.view.tweet {
|
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
acc:lpush('</a> retweeted</div>')
if co.aid ~= 0 and co.who.id == rter.id then
acc:lpush('<a href="/post/'):shpush(rid):lpush('/del" class="del">✖</a>')
end
end
local terra
render_tweet(co: &lib.srv.convo, p: &lib.store.post, acc: &lib.str.acc): pstr
var author: &lib.store.actor = nil
var retweeter: &lib.store.actor = nil
for j = 0, co.actorcache.top do
if p.author == co.actorcache(j).ptr.id then author = co.actorcache(j).ptr end
if p.rtdby == co.actorcache(j).ptr.id then retweeter = co.actorcache(j).ptr end
if author ~= nil and (p.rtdby == 0 or retweeter ~= nil) then
goto foundauth
................................................................................
author = co.actorcache:insert(co:uid2actor_live(p.author)).ptr
end
if p.rtdby ~= 0 and retweeter == nil then
retweeter = co.actorcache:insert(co:uid2actor_live(p.rtdby)).ptr
end
::foundauth::
if author.relationship.rel.mute() or
author.relationship.recip.exclude() then return '' end
var timestr: int8[26] lib.osclock.ctime_r(&p.posted, ×tr[0])
for i=0,26 do if timestr[i] == @'\n' then timestr[i] = 0 break end end -- 🙄
var ptxt = pstr {ptr=p.body,ct=lib.str.sz(p.body)}
if author.relationship.rel.disemvowel() then
ptxt = lib.str.disemvowel(&co.srv.pool, ptxt)
end
var bhtml = lib.smackdown.html(&co.srv.pool, ptxt,false)
--defer bhtml:free()
var idbuf: int8[lib.math.shorthand.maxlen]
var idlen = lib.math.shorthand.gen(p.id, idbuf)
var permalink: lib.str.acc permalink:pool(&co.srv.pool, 7+idlen):lpush('/post/'):push(idbuf,idlen)
var fullname = lib.render.nym(author,0,nil, false) defer fullname:free()
var tpl = data.view.tweet {
|