parsav  Diff

Differences From Artifact [745afb2f25]:

To Artifact [1e81acf0af]:


    30     30   		                      else pflink:lpush('/@') end
    31     31   		pflink:push(who(0).xid,0)
    32     32   		var n = data.view.notice {
    33     33   			avatar = cs(who(0).avatar);
    34     34   			nym = lib.render.nym(who.ptr,0,nil,true);
    35     35   			pflink = pstr{ptr = pflink.buf; ct = pflink.sz};
    36     36   		}
    37         -		var notweet = true
    38         -		var what = co.srv:post_fetch(notes(i).what) defer what:free()
           37  +		var notweet, nopost = true, false
    39     38   		switch notes(i).kind do
    40     39   			case lib.store.noticetype.rt then
    41     40   				n.kind = P'rt'
    42     41   				n.act = P'retweeted your post'
    43     42   			end
    44     43   			case lib.store.noticetype.like then
    45     44   				n.kind = P'like'
    46     45   				n.act = P'likes your post'
    47     46   			end
    48     47   			case lib.store.noticetype.reply then
    49     48   				n.kind = P'reply'
    50     49   				n.act = P'replied to your post'
    51     50   				notweet = false
           51  +			end
           52  +			case lib.store.noticetype.follow then
           53  +				n.kind = P'follow'
           54  +				n.act = P'followed you!'
           55  +				nopost = true
    52     56   			end
    53     57   		else goto skip end
    54         -		do var idbuf: int8[lib.math.shorthand.maxlen]
    55         -			var idlen = lib.math.shorthand.gen(notes(i).what, idbuf)
           58  +		if not nopost then
           59  +			var what = co.srv:post_fetch(notes(i).what) defer what:free()
    56     60   			var b = lib.smackdown.html(&co.srv.pool, pstr {ptr=what(0).body,ct=0},true) --defer b:free()
    57         -			body:lpush(' <a class="quote" href="/post/'):push(&idbuf[0],idlen):lpush('">'):ppush(b):lpush('</a>')
           61  +			body:lpush(' <a class="quote" href="/post/'):shpush(notes(i).what):lpush('">'):ppush(b):lpush('</a>')
    58     62   		end
    59     63   		if not notweet then
    60     64   			var reply = co.srv:post_fetch(notes(i).reply)
    61     65   				lib.render.tweet(co,reply.ptr,&body)
    62     66   			reply:free()
    63     67   		end
    64     68   		n.ref = pstr {ptr = body.buf, ct = body.sz}
    65         -
    66     69   		n:append(&pg)
           70  +
    67     71   		::skip:: n.nym:free()
    68     72   		         pflink:reset()
    69     73   				 body:reset()
    70     74   	end
    71     75   	--pflink:free()
    72     76   	pg:lpush('<form method="post"><button name="act" value="clear">clear all notices</button></form>')
    73     77   	co:livepage([lib.srv.convo.page] {