1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
-- vim: ft=terra
local terra
render_userpage(
co : &lib.srv.convo,
actor : &lib.store.actor,
relationship: &lib.store.relationship
): {}
var ti: lib.str.acc
if co.aid ~= 0 and co.who.id == actor.id then
ti:compose('my profile')
else
ti:compose('profile :: ', actor.handle)
end
var tiptr = ti:finalize()
var acc: lib.str.acc acc:pool(&co.srv.pool, 1024)
var pftxt = lib.render.profile(co,actor,relationship) --defer pftxt:free()
acc:ppush(pftxt)
var stoptime = lib.osclock.time(nil)
var posts = co.srv:post_enum_author_uid(actor.id, lib.store.range {
................................................................................
posts(i):free()
end
posts:free()
acc:lpush('</div>')
var bdf = acc:finalize()
co:livepage([lib.srv.convo.page] {
title = tiptr; body = bdf;
class = 'profile';
cache = false;
}, newest)
tiptr:free()
--bdf:free()
end
return render_userpage
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
-- vim: ft=terra
local terra
render_userpage(
co : &lib.srv.convo,
actor : &lib.store.actor,
relationship: &lib.store.relationship
): {}
var ti: lib.str.t
if co.aid ~= 0 and co.who.id == actor.id then
ti = 'my profile'
else
ti = co:qstr('profile :: ', actor.handle)
end
var acc: lib.str.acc acc:pool(&co.srv.pool, 1024)
var pftxt = lib.render.profile(co,actor,relationship) --defer pftxt:free()
acc:ppush(pftxt)
var stoptime = lib.osclock.time(nil)
var posts = co.srv:post_enum_author_uid(actor.id, lib.store.range {
................................................................................
posts(i):free()
end
posts:free()
acc:lpush('</div>')
var bdf = acc:finalize()
co:livepage([lib.srv.convo.page] {
title = ti; body = bdf;
class = 'profile';
cache = false;
}, newest)
--tiptr:free()
--bdf:free()
end
return render_userpage
|