3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
local terra cs(s: rawstring)
return pstr { ptr = s, ct = lib.str.sz(s) }
end
local terra
render_profile(co: &lib.srv.convo, actor: &lib.store.actor)
var aux: lib.str.acc
if co.aid ~= 0 and co.who.id == actor.id then
aux:compose('<a href="/conf/profile?go=/',actor.xid,'">alter</a>')
elseif co.aid ~= 0 then
aux:compose('<a href="/', actor.xid, '/follow">follow</a><a href="/',
actor.xid, '/chat">chat</a>')
if co.who.rights.powers:affect_users() then
aux:lpush('<a href="/'):push(actor.xid,0):lpush('/ctl">control</a>')
end
else
aux:compose('<a href="/', actor.xid, '/follow">remote follow</a>')
end
var auxp = aux:finalize()
var avistr: lib.str.acc if actor.origin == 0 then
avistr:compose('/avi/',actor.handle)
end
var timestr: int8[26] lib.osclock.ctime_r(&actor.knownsince, ×tr[0])
|
|
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
local terra cs(s: rawstring)
return pstr { ptr = s, ct = lib.str.sz(s) }
end
local terra
render_profile(co: &lib.srv.convo, actor: &lib.store.actor)
var aux: lib.str.acc
var followed = true -- FIXME
if co.aid ~= 0 and co.who.id == actor.id then
aux:compose('<a class="button" href="/conf/profile?go=/',actor.xid,'">alter</a>')
elseif co.aid ~= 0 then
if not followed then
aux:compose('<button method="post" name="act" value="follow">follow</a>')
elseif not followed then
aux:compose('<button method="post" name="act" value="unfollow">unfollow</a>')
end
aux:lpush('<a href="/'):push(actor.xid,0):lpush('/chat">chat</a>')
if co.who.rights.powers:affect_users() then
aux:lpush('<a class="button" href="/'):push(actor.xid,0):lpush('/ctl">control</a>')
end
else
aux:compose('<a class="button" href="/', actor.xid, '/follow">remote follow</a>')
end
var auxp = aux:finalize()
var avistr: lib.str.acc if actor.origin == 0 then
avistr:compose('/avi/',actor.handle)
end
var timestr: int8[26] lib.osclock.ctime_r(&actor.knownsince, ×tr[0])
|