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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
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 class="button" href="/conf/profile?go=/@',actor.handle,'">alter</a>')
elseif co.aid ~= 0 then
if not followed then
aux:compose('<button method="post" class="pos" name="act" value="follow">follow</button>')
elseif followed then
aux:compose('<button method="post" class="neg" name="act" value="unfollow">unfollow</button>')
end
aux:lpush('<a 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 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 timestr: int8[26] lib.osclock.ctime_r(&actor.knownsince, ×tr[0])
var strfbuf: int8[28*4]
var stats = co.srv:actor_stats(actor.id)
var sn_posts = cs(lib.math.decstr_friendly(stats.posts, &strfbuf[ [strfbuf.type.N - 1] ]))
var sn_follows = cs(lib.math.decstr_friendly(stats.follows, sn_posts.ptr - 1))
var sn_followers = cs(lib.math.decstr_friendly(stats.followers, sn_follows.ptr - 1))
var sn_mutuals = cs(lib.math.decstr_friendly(stats.mutuals, sn_followers.ptr - 1))
var bio = lib.str.plit "<em>tall, dark, and mysterious</em>"
if actor.bio ~= nil then
bio = lib.smackdown.html(cs(actor.bio))
end
var fullname = lib.render.nym(actor,0,nil,false) defer fullname:free()
var comments: lib.str.acc comments:init(64)
-- this is really more what epithets are for, i think
--if actor.rights.rank > 0 then comments:lpush('<li>staff member</li>') end
if co.srv.cfg.master == actor.id then
comments:lpush('<li style="--co:-70">founder</li>')
end
if co.aid ~= 0 and actor.rights.rank ~= 0 then
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
|
|
|
|
|
|
|
|
<
<
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
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
aux:compose('<a accesskey="f" class="button" href="/', actor.xid, '/follow">remote follow</a>')
end
var auxp = aux:finalize()
var timestr: int8[26] lib.osclock.ctime_r(&actor.knownsince, ×tr[0])
var strfbuf: int8[28*4]
var stats = co.srv:actor_stats(actor.id)
var sn_posts = cs(lib.math.decstr_friendly(stats.posts, &strfbuf[ [strfbuf.type.N - 1] ]))
var sn_follows = cs(lib.math.decstr_friendly(stats.follows, sn_posts.ptr - 1))
var sn_followers = cs(lib.math.decstr_friendly(stats.followers, sn_follows.ptr - 1))
var sn_mutuals = cs(lib.math.decstr_friendly(stats.mutuals, sn_followers.ptr - 1))
var bio = lib.str.plit '<em style="opacity:0.6">tall, dark, and mysterious</em>'
if actor.bio ~= nil then
bio = lib.smackdown.html(cs(actor.bio))
end
var fullname = lib.render.nym(actor,0,nil,false) defer fullname:free()
var comments: lib.str.acc comments:init(64)
if co.srv.cfg.master == actor.id then
var foundertxt = lib.str.plit 'founder'
if co.srv.cfg.ui_cue_founder:ref() then
if co.srv.cfg.ui_cue_founder.ct == 0 -- empty string, suppress field
then foundertxt = pstr.null()
else foundertxt = co.srv.cfg.ui_cue_founder
end
end
if foundertxt:ref() then
comments:lpush('<li style="--co:-70">'):ppush(foundertxt):lpush('</li>')
end
end
if co.aid ~= 0 and actor.rights.rank ~= 0 then
var stafftxt = lib.str.plit 'site staff'
if co.srv.cfg.ui_cue_staff:ref() then
if co.srv.cfg.ui_cue_staff.ct == 0 -- empty string, suppress field
then stafftxt = pstr.null()
else stafftxt = co.srv.cfg.ui_cue_staff
end
end
-- this is really more what epithets are for, i think
if actor.rights.rank > 0 and stafftxt:ref() then
comments:lpush('<li>'):ppush(stafftxt):lpush('</li>')
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
|