1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
-- vim: ft=terra
local pstr = lib.mem.ptr(int8)
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 = false -- FIXME
if co.aid ~= 0 and co.who.id == actor.id then
aux:compose('<a accesskey="a" class="button" href="/conf/profile?go=/@',actor.handle,'">alter</a>')
elseif co.aid ~= 0 then
if not followed then
aux:compose('<button accesskey="f" method="post" class="pos" name="act" value="follow">follow</button>')
elseif followed then
aux:compose('<button accesskey="f" method="post" class="neg" name="act" value="unfollow">unfollow</button>')
end
aux:lpush('<a accesskey="h" class="button" href="/'):push(actor.xid,0):lpush('/chat">chat</a>')
if co.who.rights.powers:affect_users() and co.who:overpowers(actor) then
aux:lpush('<a accesskey="n" class="button" href="/'):push(actor.xid,0):lpush('/ctl">control</a>')
end
else
................................................................................
end
if co.who:outranks(actor) then
comments:lpush('<li style="--co:50">underling</li>')
elseif actor:outranks(co.who) then
comments:lpush('<li style="--co:-50">outranks you</li>')
end
end
var profile = data.view.profile {
nym = fullname;
bio = bio;
xid = cs(actor.xid);
avatar = cs(actor.avatar);
|
|
1
2
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
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
-- vim: ft=terra
local pstr = lib.mem.ptr(int8)
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,
relationship: &lib.store.relationship
): pstr
var aux: lib.str.acc
var followed = false -- FIXME
if co.aid ~= 0 and co.who.id == actor.id then
aux:compose('<a accesskey="a" class="button" href="/conf/profile?go=/@',actor.handle,'">alter</a>')
elseif co.aid ~= 0 then
if not relationship.rel.follow() then
aux:compose('<button accesskey="f" method="post" class="pos" name="act" value="follow">follow</button>')
elseif relationship.rel.follow() then
aux:compose('<button accesskey="f" method="post" class="neg" name="act" value="unfollow">unfollow</button>')
end
aux:lpush('<a accesskey="h" class="button" href="/'):push(actor.xid,0):lpush('/chat">chat</a>')
if co.who.rights.powers:affect_users() and co.who:overpowers(actor) then
aux:lpush('<a accesskey="n" class="button" href="/'):push(actor.xid,0):lpush('/ctl">control</a>')
end
else
................................................................................
end
if co.who:outranks(actor) then
comments:lpush('<li style="--co:50">underling</li>')
elseif actor:outranks(co.who) then
comments:lpush('<li style="--co:-50">outranks you</li>')
end
if relationship.recip.follow() then
comments:lpush('<li style="--co:30">follows you</li>')
end
end
var profile = data.view.profile {
nym = fullname;
bio = bio;
xid = cs(actor.xid);
avatar = cs(actor.avatar);
|