Differences From
Artifact [1e81acf0af]:
1 1 -- vim: ft=terra
2 2 local pstr = lib.mem.ptr(int8)
3 -local P = lib.str.plit
4 3 local terra cs(s: rawstring)
5 4 return pstr { ptr = s, ct = lib.str.sz(s) }
6 5 end
7 6
8 7 local terra
9 8 render_notices(
10 9 co: &lib.srv.convo
................................................................................
33 32 avatar = cs(who(0).avatar);
34 33 nym = lib.render.nym(who.ptr,0,nil,true);
35 34 pflink = pstr{ptr = pflink.buf; ct = pflink.sz};
36 35 }
37 36 var notweet, nopost = true, false
38 37 switch notes(i).kind do
39 38 case lib.store.noticetype.rt then
40 - n.kind = P'rt'
41 - n.act = P'retweeted your post'
39 + n.kind = 'rt'
40 + n.act = 'retweeted your post'
42 41 end
43 42 case lib.store.noticetype.like then
44 - n.kind = P'like'
45 - n.act = P'likes your post'
43 + n.kind = 'like'
44 + n.act = 'likes your post'
46 45 end
47 46 case lib.store.noticetype.reply then
48 - n.kind = P'reply'
49 - n.act = P'replied to your post'
47 + n.kind = 'reply'
48 + n.act = 'replied to your post'
50 49 notweet = false
51 50 end
52 51 case lib.store.noticetype.follow then
53 - n.kind = P'follow'
54 - n.act = P'followed you!'
52 + n.kind = 'follow'
53 + n.act = 'followed you!'
55 54 nopost = true
56 55 end
57 56 else goto skip end
58 57 if not nopost then
59 58 var what = co.srv:post_fetch(notes(i).what) defer what:free()
60 59 var b = lib.smackdown.html(&co.srv.pool, pstr {ptr=what(0).body,ct=0},true) --defer b:free()
61 60 body:lpush(' <a class="quote" href="/post/'):shpush(notes(i).what):lpush('">'):ppush(b):lpush('</a>')
................................................................................
71 70 ::skip:: n.nym:free()
72 71 pflink:reset()
73 72 body:reset()
74 73 end
75 74 --pflink:free()
76 75 pg:lpush('<form method="post"><button name="act" value="clear">clear all notices</button></form>')
77 76 co:livepage([lib.srv.convo.page] {
78 - title = P'notices', class = P'notices';
77 + title = 'notices', class = 'notices';
79 78 body = pstr {ptr = pg.buf, ct = pg.sz};
80 79 cache = false;
81 80 }, latest)
82 81 end
83 82
84 83 return render_notices