-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c96b23c
commit e8cefe8
Showing
3 changed files
with
22 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@@ This is a strange little patch that adds the +bbcomment <board>/<post>/<subject>=<text> command to the BBS. | ||
|
||
@switch/inline gt(match(get(u(bbs)/VAR`BB`PLAYCOMMS),COMMENT,|),0)=0,{&VAR`BB`PLAYCOMMS u(bbs)=cat(get(u(bbs)/VAR`BB`PLAYCOMMS),|COMMENT)} | ||
|
||
&FUN`MSGFLAG u(bbs)=if(match(get(%0/D`BB`%1`READ),%2),if(nattr(%1/%2`COMM`*),if(match(get(%1/%2`COMMREAD),%#),,C)),U) | ||
|
||
&INC`READ`SHOWPOST u(bbs)=@include u(bbs)/INC`CHECK`FINDPOST=%0,%1,%2;@nspemit %#=header(u(fun`name,%2,%q<gid1>));@nspemit %#=ljust(Message: [color(%#,%q<bbnum>/%q<postnum>,BBS`POSTNUM,n)] [color(%#,\([if(not(u(FUN`CONFIG,autotimeout)),No System Timeout,if(not(u(FUN`CONFIG,%q<bb>,timeout)),No Board Timeout,if(eq(get(%q<bb>/%q<post>`TIMEOUT),0),No Post Timeout,timestring(bound(abs(sub(secs(),add(strfirstof(get(%q<bb>/%q<post>`TIMEOUT),u(FUN`CONFIG,%q<bb>,timeout)),strfirstof(get(%q<bb>/%q<post>`EDITED),get(%q<bb>/%q<post>`ON))))),0)))))]\),BBS`POSTTIMEOUT,n)],35)Posted[space(8)]Author%r[ljust(color(%#,get(%2/%q<post>`HDR),BBS`POSTTITLE,n),35)][ljust(color(%#,timefmt($b $d $Y,lmath(max,firstof(get(%2/%q<post>`EDITED),get(%2/%q<post>`ON)))),BBS`POSTDATE,n),14)][left(color(%#,if(get(u(bbs)/BB`%q<bb>`ANONYMOUS),if(%q<isadmin>,([ansi(hx,get(%q<bb>/%q<post>`BY))]),default(u(bbs)/BB`%q<bb>`ANONYMOUS,Anonymous)),get(%q<bb>/%q<post>`BY)),BBS`POSTAUTHOR,n),21)]%R[header()];@nspemit %#=get(%q<bb>/%q<post>);th setq(oldids,setdiff(get(%#/D`BB`%2`READ),lattr(%2/*)));&D`BB`%2`READ %#=setunion(setdiff(get(%#/D`BB`%2`READ),%q<oldids>),%q<post>);@switch/inline gt(nattr(%q<bb>/%q<post>`COMM`*),0)=1,{@include u(bbs)/INC`READ`SHOWCOMMS;&%q<post>`COMMREAD %q<bb>=setunion(get(%q<bb>/%q<post>`COMMREAD),%#)},0,{@nspemit %#=header()} | ||
|
||
&INC`READ`SHOWCOMMS u(bbs)=@dolist/inline sortkey(#lambda/last(\%0,`),lattr(%q<bb>/%q<post>`COMM`*))={@nspemit %#=header(Comment [last(%i0,`)] - Added [color(%#,timefmt($b $d $Y,get(%q<bb>/%i0`ON)),BBS`POSTDATE,n)]);@nspemit %#=ansi(h,get(%q<bb>/%i0`BY)) Commented:;@nspemit %#=get(%q<bb>/%i0)};@nspemit %#=header() | ||
|
||
&INC`COMMENT u(bbs)=@include u(bbs)/INC`CHECK`FINDBB=%0,%1,WRITE;@include u(bbs)/INC`CHECK`FINDPOST=%0,before(%2,/),%q<bb>;@assert strlen(after(%2,/))=@nspemit %#=announce(%q<ann>) ERROR: Subject field empty!;@assert strlen(%3)=@nspemit %#=announce(%q<ann>) ERROR: Comment contents empty!;&[setr(attr,%q<post>`COMM`[nextslot(%q<bb>,%q<post>`COMM)])] %q<bb>=%3;&%q<attr>`BY %q<bb>=%n;&%q<attr>`BYDB %q<bb>=%:;&%q<attr>`HDR %q<bb>=after(%2,/);&%q<attr>`ON %q<bb>=secs();&%q<post>`EDITED %q<bb>=secs();@include u(bbs)/INC`ALERT=%0,%q<bbnum>,%q<bb>,{(New Comment added to [ucstr(%0)] Message ([pueblize(setr(messnum,%q<bbnum>/%q<postnum>),+[lcstr(%0)]read %q<messnum>)]) '[get(%q<bb>/%q<post>`HDR)]' on '[name(%q<bb>)]' by %n: [after(%2,/)])};@wipe %q<bb>/%q<post>`COMMREAD | ||
|
||
&INC`SCAN u(bbs)=@assert words(setr(groups,filterbool(#lambda/or(strlen(setdiff(lattr(\%0/*),get(%#/D`BB`\%0`READ))),lmath(max,iter(lattr(\%0/*),strmatch(u(FUN`MSGFLAG,%#,\%0,\%i0),C)))),u(FUN`VALIDGROUPS`%0,%#,READ))))=@nspemit %#=announce(%q<ann>) There are no unread postings on the %q<ann>.;@nspemit %#=header(u(FUN`NAME) - Unread Postings);@dolist/inline %q<groups>={@nspemit %#=pueblize(name(%i0) (#[match(u(FUN`LISTGROUPS`%0),%i0)]),+[lcstr(%0)]read [match(u(FUN`LISTGROUPS`%0),%i0)]): [setr(num,words(setr(unread,sortkey(#lambda/baseconv(\%0,36,10),setunion(setdiff(lattr(%i0/*),get(%#/D`BB`%i0`READ)),filterbool(#lambda/strmatch(u(FUN`MSGFLAG,%#,%i0,\%0),C),lattr(%i0/*)))))))] unread ([itemize(iter(%q<unread>,pueblize(match(u(FUN`LISTPOSTS,%i1),%i0),+[lcstr(%0)]read [match(u(FUN`LISTGROUPS`%0),%i1)]/[match(u(FUN`LISTPOSTS,%i1),%i0)])),%b,and,\,)]);th setq(total,add(%q<total>,%q<num>))};@nspemit %#=header(Total Unread: %q<total>) | ||
|
||
&INC`NEXT u(bbs)=@assert isdbref(setr(bb,first(filterbool(#lambda/or(strlen(setdiff(lattr(\%0/*),get(%#/D`BB`\%0`READ))),lmath(max,iter(lattr(\%0/*),strmatch(u(FUN`MSGFLAG,%#,\%0,\%i0),C)))),u(FUN`VALIDGROUPS`%0,%#,READ)))))=@nspemit %#=announce(%q<ann>) There are no unread postings on the %q<ann>.;th setq(msg,first(sortkey(#lambda/baseconv(\%0,36,10),setunion(setdiff(lattr(%q<bb>/*),get(%#/D`BB`%q<bb>`READ)),filterbool(#lambda/strmatch(u(FUN`MSGFLAG,%#,%q<bb>,\%0),C),lattr(%q<bb>/*))))));th setr(bbnum,match(u(FUN`LISTGROUPS`%0),%q<bb>));@include u(bbs)/INC`READ`SHOWPOST=%0,match(u(FUN`LISTPOSTS,%q<bb>),%q<msg>),%q<bb> | ||
|
||
&INC`ALL u(bbs)=@assert words(setr(allunread,filterbool(#lambda/or(strlen(setdiff(lattr(\%0/*),get(%#/D`BB`\%0`READ))),lmath(max,iter(lattr(\%0/*),strmatch(u(FUN`MSGFLAG,%#,\%0,\%i0),C)))),u(FUN`VALIDGROUPS`%0,%#,READ))))=@nspemit %#=announce(%q<ann>) There are no Unread messages on the %q<ann>!;@dolist/inline %q<allunread>={@switch/inline %0=BB,{@force/inplace %#=+bbread %i0/u},GB,{@force/inplace %#=+gbread %i0/u}} | ||
|
||
&FUN`MESSLIST u(bbs)=setunion(iter(%2,switch(1,valnum(%i0),%i0,regmatchi(%i0,^\\d+-\\d+$),setq(num1,abs(before(%i0,-)),num2,abs(after(%i0,-)))[setq(ord,sort(%q<num1> %q<num2>))][lnum(first(%q<ord>),last(%q<ord>))],strmatch(%i0,u),iter(setunion(setdiff(lattr(%1/*),get(%0/D`BB`%1`READ)),filterbool(#lambda/strmatch(u(FUN`MSGFLAG,%0,%1,\%0),C),lattr(%1/*))),match(u(FUN`LISTPOSTS,%1),%i0)),0),\,,%B),,%B,n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters