Check-in [29c25f391e]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Show message about nobody is online
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 29c25f391e1d659fb5987d8a294b1acc888ea352
User & Date: bernd 2019-07-05 20:42:22
Context
2019-07-05
22:14
Saving away in Chinese check-in: 9e33f84c70 user: bernd tags: trunk
20:42
Show message about nobody is online check-in: 29c25f391e user: bernd tags: trunk
15:01
Add better chain support check-in: 8afee7be22 user: bernd tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to classes.fs.

   170    170       method like
   171    171       method lock
   172    172       method unlock
   173    173       method away
   174    174       method end
   175    175       method display   \ display one message
   176    176       method redisplay \ display full set
          177  +    method .nobody   \ show nobody is online
   177    178   }class
   178    179   
   179    180   cmd-class class{ pay
   180    181       field: sources[]    \ all the sources stored here, an array
   181    182       field: sinks[]      \ all the signatures stored here, an array
   182    183       field: assets[]     \ all selected assets (array [asset,amount]*)
   183    184       field: balances[]   \ all balances (amount[asset])

Changes to gui.fs.

   408    408   $FFFFFFFF text-color: realwhite
   409    409   $FFFFFFFF new-color: edit-bg
   410    410   $80FF80FF new-color: send-color
   411    411   $00FF0020 new-color: pet-color
   412    412   $FFFF80FF new-color, fvalue users-color#
   413    413   $FFCCCCFF new-color, fvalue gps-color#
   414    414   $000077FF new-color, fvalue chain-color#
          415  +$FF000000 $FF0000FF fade-color: show-error-color
   415    416   
   416    417   : nick[] ( box o:nick -- box )
   417    418       [: data >o ." clicked on " ke-nick $. cr o> ;] o click[] ;
   418    419   
   419    420   Hash: avatar#
   420    421   
   421    422   glue new Constant glue*avatar
................................................................................
   808    809   
   809    810   :noname ( -- )
   810    811       glue*ll }}glue msg-box .child+
   811    812       dpy-w @ 90% fm* msg-par .par-split
   812    813       {{ msg-par unbox }}
   813    814       dup >r 0 ?DO  I pick box[] "unboxed" name! drop  LOOP  r>
   814    815       msg-vbox .+childs
   815         -; wmsg-class to msg:end
          816  +; wmsg-class is msg:end
          817  +0 Value nobody-online-text \ nobody is online warning
          818  +:noname 2e nobody-online-text [: f2* sin-t .fade +sync ;] >animate
          819  +; wmsg-class is msg:.nobody
   816    820   : new-msg-par ( -- )
   817    821       {{ }}p "msg-par" name!
   818    822       dup .subbox box[] drop box[] cbl >bl
   819    823       dup .subbox "msg-box" name!
   820    824       to msg-box to msg-par ;
   821    825   :noname { d: pk -- o }
   822    826       pk [: .simple-id ." : " ;] $tmp notify-nick!
................................................................................
   860    864   		me? >bubble-border
   861    865   	    }}z box[] "msg-zbox" name!
   862    866   	    glue*ll }}glue
   863    867   	    me? IF  swap rot  THEN
   864    868   	}}h box[] "msgs-box" name! msgs-box .child+
   865    869   	blackish
   866    870       THEN
   867         -; wmsg-class to msg:start
          871  +; wmsg-class is msg:start
   868    872   :noname { d: string -- o }
   869    873       link-blue \mono string [: '#' emit type ;] $tmp
   870    874       ['] utf8-sanitize $tmp }}text text-color! \sans
   871    875       msg-box .child+
   872         -; wmsg-class to msg:tag
          876  +; wmsg-class is msg:tag
   873    877   :noname { d: string -- o }
   874    878       text-color!
   875    879       string ['] utf8-sanitize $tmp }}text 25%bv
   876    880       "text" name! msg-box .child+
   877         -; wmsg-class to msg:text
          881  +; wmsg-class is msg:text
   878    882   :noname { d: string -- o }
   879    883       \italic last-otr? IF light-blue ELSE dark-blue THEN
   880    884       string ['] utf8-sanitize $tmp }}text 25%bv \regular
   881    885       text-color!
   882    886       "action" name! msg-box .child+
   883         -; wmsg-class to msg:action
          887  +; wmsg-class is msg:action
   884    888   :noname { d: string -- o }
   885    889       last-otr? IF light-blue ELSE dark-blue THEN
   886    890       string ['] utf8-sanitize $tmp }}text _underline_ 25%bv
   887    891       text-color!
   888    892       [: data >o text$ o> open-url ;]
   889    893       over click[]
   890    894       click( ." url: " dup ..parents cr )
   891    895       "url" name! msg-box .child+
   892         -; wmsg-class to msg:url
          896  +; wmsg-class is msg:url
   893    897   :noname { d: string -- o }
   894    898       {{
   895    899   	glue*l gps-color# slide-frame dup .button1
   896    900   	string [: ."  GPS: " .coords ;] $tmp }}text 25%b
   897    901       }}z "gps" name! msg-box .child+
   898         -; wmsg-class to msg:coord
          902  +; wmsg-class is msg:coord
   899    903   :noname { d: string -- o }
   900    904       {{
   901    905   	glue*l chain-color# slide-frame dup .button1
   902    906   	string sighash? IF  re-green  ELSE  obj-red  THEN
   903    907   	string [: ." <" drop le-64@ .ticks ;] $tmp }}text 25%b
   904    908       }}z "chain" name! msg-box .child+
   905         -; wmsg-class to msg:chain
          909  +; wmsg-class is msg:chain
   906    910   :noname { d: pk -- o }
   907    911       {{
   908    912   	x-color { f: xc }
   909    913   	pk key|
   910    914   	2dup 0 .pk@ key| str=
   911    915   	last-otr? IF  IF  my-signal-otr  ELSE  other-signal-otr  THEN
   912    916   	ELSE  IF  my-signal  ELSE  other-signal  THEN  THEN
   913    917   	x-color glue*l slide-frame dup .button1 40%b >r
   914    918   	black# to x-color
   915    919   	[: '@' emit .key-id ;] $tmp ['] utf8-sanitize $tmp }}text 25%b r> swap
   916    920   	xc to x-color
   917    921       }}z msg-box .child+
   918         -; wmsg-class to msg:signal
          922  +; wmsg-class is msg:signal
   919    923   :noname ( addr u -- )
   920    924       re-green [: ." [" 85type ." ]→" ;] $tmp }}text msg-box .child+
   921    925       text-color!
   922         -; wmsg-class to msg:re
          926  +; wmsg-class is msg:re
   923    927   :noname ( addr u -- )
   924    928       obj-red [: ." [" 85type ." ]:" ;] $tmp }}text msg-box .child+
   925    929       text-color!
   926         -; wmsg-class to msg:id
          930  +; wmsg-class is msg:id
   927    931   :noname { sig u' addr u -- }
   928    932       u' 64'+ u =  u sigsize# = and IF
   929    933   	addr u startdate@ 64dup date>i >r 64#1 64+ date>i' r>
   930    934   	\ 2dup = IF  ."  [otrified] "  addr u startdate@ .ticks  THEN
   931    935   	U+DO
   932    936   	    I msg-group-o .msg:log[] $[]@
   933    937   	    2dup dup sigpksize# - /string key| msg:id$ str= IF
................................................................................
   978    982       vp-y fnegate to vmotion-dy
   979    983       0.333e o ['] vp-scroll >animate o> ;
   980    984   
   981    985   : wmsg-display ( addr u -- )
   982    986       msg-tdisplay
   983    987       msgs-box >o [: +sync +resize ;] vp-needed vp-bottom
   984    988       +sync +resize o> ;
   985         -' wmsg-display wmsg-class to msg:display
          989  +' wmsg-display wmsg-class is msg:display
   986    990   
   987    991   #128 Value gui-msgs# \ display last 128 messages
   988    992   0 Value chat-edit    \ chat edit field
   989    993   0 Value chat-edit-bg \ chat edit background
   990    994   
   991    995   : (gui-msgs) ( gaddr u -- )
   992    996       reset-time
................................................................................
  1057   1061   		dup font-size# 66% f* fdup vslider
  1058   1062   	    over >r }}h box[] r>
  1059   1063   	    font-size# 66% f* fdup hslider
  1060   1064   	}}v box[]
  1061   1065   	{{
  1062   1066   	    {{ glue*lll edit-bg x-color font-size# 40% f* }}frame dup .button3
  1063   1067   		dup to chat-edit-bg
  1064         -		{{ \normal \regular blackish "" }}edit 40%b dup to chat-edit glue*l }}glue
         1068  +		show-error-color \normal \regular
         1069  +		!i18n l" Nobody is online" }}text' !lit
         1070  +		dup to nobody-online-text /center
         1071  +		{{ blackish "" }}edit 40%b dup to chat-edit glue*l }}glue
  1065   1072   		    glue*lll }}glue
  1066   1073   		}}h box[]
  1067   1074   	    }}z chat-edit [: edit-w .chat-edit-enter drop nip 0 tuck false ;] edit[] ' size-limit filter[]
  1068   1075   	    >o act >o [: connection .chat-next-line ;] is edit-next-line o> o o>
  1069   1076   	    >o act >o [: connection .chat-prev-line ;] is edit-prev-line o> o o>
  1070   1077   	    {{
  1071   1078   		glue*l send-color x-color font-size# 40% f* }}frame dup .button2

Changes to lang/de.

    10     10   Öffentlicher Schlüssel
    11     11   Schlüsselsignaturdatum
    12     12   Meine Schlüssel
    13     13   Meine Gruppen
    14     14   Meine Freunde
    15     15   Posting
    16     16             17  +Niemand ist online, speichere weg
    17     18      18     19   Einladungen

Changes to lang/en.

    10     10   Pubkey
    11     11   Key date
    12     12   My key
    13     13   My groups
    14     14   My peers
    15     15   Post
    16     16             17  +Nobody is online, saving away
    17     18      18     19   Invitations

Changes to lang/zh.

    10     10   公钥
    11     11   关键签名日期
    12     12   我的钥匙
    13     13   我的集团
    14     14   我的朋友
    15     15   贴子
    16     16             17  +没有人在线
    17     18   发送
    18     19   请帖

Changes to msg.fs.

   478    478   	0
   479    479       endcase ." ]" <default> ;
   480    480   msg-class is msg:object
   481    481   :noname ( addr u -- ) $utf8>
   482    482       <warn> forth:type <default> ; msg-class is msg:action
   483    483   :noname ( addr u -- )
   484    484       <warn> ."  GPS: " .coords <default> ; msg-class is msg:coord
          485  +
          486  +: wait-2s-key ( -- )
          487  +    ntime 50 0 DO  key? ?LEAVE
          488  +    2dup i #40000000 um* d+ deadline  LOOP  2drop ;
          489  +: xclear ( addr u -- ) x-width 1+ x-erase ;
          490  +
          491  +:noname ( -- )
          492  +    <info>
          493  +    [: ." nobody's online" msg-group-o .msg:?otr 0= IF ." , saving away"  THEN ;] $tmp
          494  +    2dup type <default>
          495  +    wait-2s-key xclear ; msg-class is msg:.nobody
          496  +
   485    497   : replace-sig { addrsig usig addrmsg umsg -- }
   486    498       \ !!dummy!! need to verify signature!
   487    499       addrsig usig addrmsg umsg usig - [: type type ;] $tmp
   488    500       2dup pk-sig? !!sig!! 2drop addrmsg umsg smove ;
   489    501   : new-otrsig ( addr u -- addrsig usig )
   490    502       2dup startdate@ old>otr
   491    503       c:0key sigpksize# - c:hash ['] .sig $tmp 1 64s /string ;
................................................................................
  1120   1132   : chat-history ( -- )
  1121   1133       chat-terminal edit-out ! ;
  1122   1134   
  1123   1135   \ chat line editor
  1124   1136   
  1125   1137   $200 Constant maxmsg#
  1126   1138   
  1127         -: xclear ( addr u -- ) x-width 1+ x-erase ;
  1128         -
  1129   1139   : get-input-line ( -- addr u )
  1130   1140       BEGIN  pad maxmsg# ['] accept catch
  1131   1141   	dup dup -56 = swap -28 = or \ quit or ^c to leave
  1132   1142   	IF    drop 2drop "/bye"
  1133   1143   	ELSE
  1134   1144   	    dup 0= IF
  1135   1145   		drop pad swap 2dup xclear
................................................................................
  1150   1160       connection .data-rmap 0= ?EXIT
  1151   1161       net2o-code expect-msg
  1152   1162       log !time end-with join, get-ip end-code ;
  1153   1163   
  1154   1164   : chat-entry ( -- )  ?.net2o/chats  word-args
  1155   1165       <warn> ." Type ctrl-D or '/bye' as single item to quit" <default> cr ;
  1156   1166   
  1157         -: wait-2s-key ( -- )
  1158         -    ntime 50 0 DO  key? ?LEAVE
  1159         -    2dup i #40000000 um* d+ deadline  LOOP  2drop ;
  1160         -: .nobody ( -- )
  1161         -    <info>
  1162         -    [: ." nobody's online" msg-group-o .msg:?otr 0= IF ." , saving away"  THEN ;] $tmp
  1163         -    2dup type <default>
  1164         -    wait-2s-key xclear ;
  1165         -
  1166   1167   also net2o-base
  1167   1168   \ chain messages to one previous message
  1168   1169   : chain, ( msgaddr u -- )
  1169   1170       [: 2dup startdate@ 64#0 { 64^ sd } sd le-64!  sd 1 64s forth:type
  1170   1171   	c:0key sigonly@ >hash hashtmp hash#128 forth:type ;] $tmp $, msg-chain ;
  1171   1172   
  1172   1173   : (send-avalanche) ( xt -- addr u flag )
  1173   1174       [: 0 >o [: sign[ msg-start execute msg> ;] gen-cmd$ o>
  1174   1175         +last-signed msg-log, ;] [group] ;
  1175   1176   previous
  1176   1177   : send-avalanche ( xt -- )
  1177   1178       msg-group-o .msg:?otr IF  now>otr  ELSE  now>never  THEN
  1178   1179       (send-avalanche)
  1179         -    >r .chat r> 0= IF  .nobody  THEN ;
         1180  +    >r .chat r> 0= IF  msg-group-o .msg:.nobody  THEN ;
  1180   1181   
  1181   1182   \ chat helper words
  1182   1183   
  1183   1184   Variable chat-keys
  1184   1185   
  1185   1186   : @/ ( addr u -- addr1 u1 addr2 u2 ) '@' $split ;
  1186   1187   : @/2 ( addr u -- addr2 u2 ) '@' $split 2nip ;