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
|
else pflink:lpush('/@') end
pflink:push(who(0).xid,0)
var n = data.view.notice {
avatar = cs(who(0).avatar);
nym = lib.render.nym(who.ptr,0,nil,true);
pflink = pstr{ptr = pflink.buf; ct = pflink.sz};
}
var notweet = true
var what = co.srv:post_fetch(notes(i).what) defer what:free()
switch notes(i).kind do
case lib.store.noticetype.rt then
n.kind = P'rt'
n.act = P'retweeted your post'
end
case lib.store.noticetype.like then
n.kind = P'like'
n.act = P'likes your post'
end
case lib.store.noticetype.reply then
n.kind = P'reply'
n.act = P'replied to your post'
notweet = false
end
else goto skip end
do var idbuf: int8[lib.math.shorthand.maxlen]
var idlen = lib.math.shorthand.gen(notes(i).what, idbuf)
var b = lib.smackdown.html(&co.srv.pool, pstr {ptr=what(0).body,ct=0},true) --defer b:free()
body:lpush(' <a class="quote" href="/post/'):push(&idbuf[0],idlen):lpush('">'):ppush(b):lpush('</a>')
end
if not notweet then
var reply = co.srv:post_fetch(notes(i).reply)
lib.render.tweet(co,reply.ptr,&body)
reply:free()
end
n.ref = pstr {ptr = body.buf, ct = body.sz}
n:append(&pg)
::skip:: n.nym:free()
pflink:reset()
body:reset()
end
--pflink:free()
pg:lpush('<form method="post"><button name="act" value="clear">clear all notices</button></form>')
co:livepage([lib.srv.convo.page] {
|
|
<
>
>
>
>
>
<
<
>
>
|
<
>
|
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
76
77
|
else pflink:lpush('/@') end
pflink:push(who(0).xid,0)
var n = data.view.notice {
avatar = cs(who(0).avatar);
nym = lib.render.nym(who.ptr,0,nil,true);
pflink = pstr{ptr = pflink.buf; ct = pflink.sz};
}
var notweet, nopost = true, false
switch notes(i).kind do
case lib.store.noticetype.rt then
n.kind = P'rt'
n.act = P'retweeted your post'
end
case lib.store.noticetype.like then
n.kind = P'like'
n.act = P'likes your post'
end
case lib.store.noticetype.reply then
n.kind = P'reply'
n.act = P'replied to your post'
notweet = false
end
case lib.store.noticetype.follow then
n.kind = P'follow'
n.act = P'followed you!'
nopost = true
end
else goto skip end
if not nopost then
var what = co.srv:post_fetch(notes(i).what) defer what:free()
var b = lib.smackdown.html(&co.srv.pool, pstr {ptr=what(0).body,ct=0},true) --defer b:free()
body:lpush(' <a class="quote" href="/post/'):shpush(notes(i).what):lpush('">'):ppush(b):lpush('</a>')
end
if not notweet then
var reply = co.srv:post_fetch(notes(i).reply)
lib.render.tweet(co,reply.ptr,&body)
reply:free()
end
n.ref = pstr {ptr = body.buf, ct = body.sz}
n:append(&pg)
::skip:: n.nym:free()
pflink:reset()
body:reset()
end
--pflink:free()
pg:lpush('<form method="post"><button name="act" value="clear">clear all notices</button></form>')
co:livepage([lib.srv.convo.page] {
|