Index: classes.fs ================================================================== --- classes.fs +++ classes.fs @@ -172,10 +172,11 @@ method unlock method away method end method display \ display one message method redisplay \ display full set + method .nobody \ show nobody is online }class cmd-class class{ pay field: sources[] \ all the sources stored here, an array field: sinks[] \ all the signatures stored here, an array Index: gui.fs ================================================================== --- gui.fs +++ gui.fs @@ -410,10 +410,11 @@ $80FF80FF new-color: send-color $00FF0020 new-color: pet-color $FFFF80FF new-color, fvalue users-color# $FFCCCCFF new-color, fvalue gps-color# $000077FF new-color, fvalue chain-color# +$FF000000 $FF0000FF fade-color: show-error-color : nick[] ( box o:nick -- box ) [: data >o ." clicked on " ke-nick $. cr o> ;] o click[] ; Hash: avatar# @@ -810,11 +811,14 @@ glue*ll }}glue msg-box .child+ dpy-w @ 90% fm* msg-par .par-split {{ msg-par unbox }} dup >r 0 ?DO I pick box[] "unboxed" name! drop LOOP r> msg-vbox .+childs -; wmsg-class to msg:end +; wmsg-class is msg:end +0 Value nobody-online-text \ nobody is online warning +:noname 2e nobody-online-text [: f2* sin-t .fade +sync ;] >animate +; wmsg-class is msg:.nobody : new-msg-par ( -- ) {{ }}p "msg-par" name! dup .subbox box[] drop box[] cbl >bl dup .subbox "msg-box" name! to msg-box to msg-par ; @@ -862,49 +866,49 @@ glue*ll }}glue me? IF swap rot THEN }}h box[] "msgs-box" name! msgs-box .child+ blackish THEN -; wmsg-class to msg:start +; wmsg-class is msg:start :noname { d: string -- o } link-blue \mono string [: '#' emit type ;] $tmp ['] utf8-sanitize $tmp }}text text-color! \sans msg-box .child+ -; wmsg-class to msg:tag +; wmsg-class is msg:tag :noname { d: string -- o } text-color! string ['] utf8-sanitize $tmp }}text 25%bv "text" name! msg-box .child+ -; wmsg-class to msg:text +; wmsg-class is msg:text :noname { d: string -- o } \italic last-otr? IF light-blue ELSE dark-blue THEN string ['] utf8-sanitize $tmp }}text 25%bv \regular text-color! "action" name! msg-box .child+ -; wmsg-class to msg:action +; wmsg-class is msg:action :noname { d: string -- o } last-otr? IF light-blue ELSE dark-blue THEN string ['] utf8-sanitize $tmp }}text _underline_ 25%bv text-color! [: data >o text$ o> open-url ;] over click[] click( ." url: " dup ..parents cr ) "url" name! msg-box .child+ -; wmsg-class to msg:url +; wmsg-class is msg:url :noname { d: string -- o } {{ glue*l gps-color# slide-frame dup .button1 string [: ." GPS: " .coords ;] $tmp }}text 25%b }}z "gps" name! msg-box .child+ -; wmsg-class to msg:coord +; wmsg-class is msg:coord :noname { d: string -- o } {{ glue*l chain-color# slide-frame dup .button1 string sighash? IF re-green ELSE obj-red THEN string [: ." <" drop le-64@ .ticks ;] $tmp }}text 25%b }}z "chain" name! msg-box .child+ -; wmsg-class to msg:chain +; wmsg-class is msg:chain :noname { d: pk -- o } {{ x-color { f: xc } pk key| 2dup 0 .pk@ key| str= @@ -913,19 +917,19 @@ x-color glue*l slide-frame dup .button1 40%b >r black# to x-color [: '@' emit .key-id ;] $tmp ['] utf8-sanitize $tmp }}text 25%b r> swap xc to x-color }}z msg-box .child+ -; wmsg-class to msg:signal +; wmsg-class is msg:signal :noname ( addr u -- ) re-green [: ." [" 85type ." ]→" ;] $tmp }}text msg-box .child+ text-color! -; wmsg-class to msg:re +; wmsg-class is msg:re :noname ( addr u -- ) obj-red [: ." [" 85type ." ]:" ;] $tmp }}text msg-box .child+ text-color! -; wmsg-class to msg:id +; wmsg-class is msg:id :noname { sig u' addr u -- } u' 64'+ u = u sigsize# = and IF addr u startdate@ 64dup date>i >r 64#1 64+ date>i' r> \ 2dup = IF ." [otrified] " addr u startdate@ .ticks THEN U+DO @@ -980,11 +984,11 @@ : wmsg-display ( addr u -- ) msg-tdisplay msgs-box >o [: +sync +resize ;] vp-needed vp-bottom +sync +resize o> ; -' wmsg-display wmsg-class to msg:display +' wmsg-display wmsg-class is msg:display #128 Value gui-msgs# \ display last 128 messages 0 Value chat-edit \ chat edit field 0 Value chat-edit-bg \ chat edit background @@ -1059,11 +1063,14 @@ font-size# 66% f* fdup hslider }}v box[] {{ {{ glue*lll edit-bg x-color font-size# 40% f* }}frame dup .button3 dup to chat-edit-bg - {{ \normal \regular blackish "" }}edit 40%b dup to chat-edit glue*l }}glue + show-error-color \normal \regular + !i18n l" Nobody is online" }}text' !lit + dup to nobody-online-text /center + {{ blackish "" }}edit 40%b dup to chat-edit glue*l }}glue glue*lll }}glue }}h box[] }}z chat-edit [: edit-w .chat-edit-enter drop nip 0 tuck false ;] edit[] ' size-limit filter[] >o act >o [: connection .chat-next-line ;] is edit-next-line o> o o> >o act >o [: connection .chat-prev-line ;] is edit-prev-line o> o o> Index: lang/de ================================================================== --- lang/de +++ lang/de @@ -12,7 +12,8 @@ Meine Schlüssel Meine Gruppen Meine Freunde Posting  +Niemand ist online, speichere weg  Einladungen Index: lang/en ================================================================== --- lang/en +++ lang/en @@ -12,7 +12,8 @@ My key My groups My peers Post  +Nobody is online, saving away  Invitations Index: lang/zh ================================================================== --- lang/zh +++ lang/zh @@ -12,7 +12,8 @@ 我的钥匙 我的集团 我的朋友 贴子  +没有人在线 发送 请帖 Index: msg.fs ================================================================== --- msg.fs +++ msg.fs @@ -480,10 +480,22 @@ msg-class is msg:object :noname ( addr u -- ) $utf8> forth:type ; msg-class is msg:action :noname ( addr u -- ) ." GPS: " .coords ; msg-class is msg:coord + +: wait-2s-key ( -- ) + ntime 50 0 DO key? ?LEAVE + 2dup i #40000000 um* d+ deadline LOOP 2drop ; +: xclear ( addr u -- ) x-width 1+ x-erase ; + +:noname ( -- ) + + [: ." nobody's online" msg-group-o .msg:?otr 0= IF ." , saving away" THEN ;] $tmp + 2dup type + wait-2s-key xclear ; msg-class is msg:.nobody + : replace-sig { addrsig usig addrmsg umsg -- } \ !!dummy!! need to verify signature! addrsig usig addrmsg umsg usig - [: type type ;] $tmp 2dup pk-sig? !!sig!! 2drop addrmsg umsg smove ; : new-otrsig ( addr u -- addrsig usig ) @@ -1122,12 +1134,10 @@ \ chat line editor $200 Constant maxmsg# -: xclear ( addr u -- ) x-width 1+ x-erase ; - : get-input-line ( -- addr u ) BEGIN pad maxmsg# ['] accept catch dup dup -56 = swap -28 = or \ quit or ^c to leave IF drop 2drop "/bye" ELSE @@ -1152,19 +1162,10 @@ log !time end-with join, get-ip end-code ; : chat-entry ( -- ) ?.net2o/chats word-args ." Type ctrl-D or '/bye' as single item to quit" cr ; -: wait-2s-key ( -- ) - ntime 50 0 DO key? ?LEAVE - 2dup i #40000000 um* d+ deadline LOOP 2drop ; -: .nobody ( -- ) - - [: ." nobody's online" msg-group-o .msg:?otr 0= IF ." , saving away" THEN ;] $tmp - 2dup type - wait-2s-key xclear ; - also net2o-base \ chain messages to one previous message : chain, ( msgaddr u -- ) [: 2dup startdate@ 64#0 { 64^ sd } sd le-64! sd 1 64s forth:type c:0key sigonly@ >hash hashtmp hash#128 forth:type ;] $tmp $, msg-chain ; @@ -1174,11 +1175,11 @@ +last-signed msg-log, ;] [group] ; previous : send-avalanche ( xt -- ) msg-group-o .msg:?otr IF now>otr ELSE now>never THEN (send-avalanche) - >r .chat r> 0= IF .nobody THEN ; + >r .chat r> 0= IF msg-group-o .msg:.nobody THEN ; \ chat helper words Variable chat-keys