Check-in [bf93e8b4ed]
Not logged in

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

Overview
Comment:Add pen to edit name
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bf93e8b4ed42dbcf5ba218fef784dd2dc0eeba23
User & Date: bernd 2020-02-12 22:44:37
Context
2020-02-13
17:47
Add debugging switch to fetch pks check-in: bf383917f7 user: bernd tags: trunk
2020-02-12
22:44
Add pen to edit name check-in: bf93e8b4ed user: bernd tags: trunk
2020-02-06
21:49
Slight change of chat check check-in: 8ec50e8d7c user: bernd tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to AndroidManifest/apps.

1
2
3
4
5
6
7
8
9
10
11
..
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
cat <<EOF
        <!-- Our activity is a homebrewn variant of the NativeAcitivity.
             This will take care of integrating with our NDK code. -->
        <activity android:name="${APP_PACKAGE}.Gforth_n2o"
                android:icon="@drawable/net2o_green"
                android:label="@string/net2o_app_name"
                android:windowAnimationStyle="@android:style/Animation.Activity"
		android:windowSoftInputMode="stateHidden|adjustResize"
                android:configChanges="orientation|screenSize|keyboardHidden"
                android:theme="@android:style/Theme.NoTitleBar"
                android:launchMode="singleTop">
................................................................................
                    android:value="net2o/startn2o.fs" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="${APP_PACKAGE}.Gforth_n2o_gui"
                android:icon="@drawable/net2o"
                android:label="@string/net2o_gui_name"
                android:windowAnimationStyle="@android:style/Animation.Activity"
		android:windowSoftInputMode="stateHidden|adjustResize"
                android:configChanges="orientation|screenSize|keyboardHidden"
                android:theme="@android:style/Theme.NoTitleBar"
                android:launchMode="singleTop">



|







 







|







1
2
3
4
5
6
7
8
9
10
11
..
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
cat <<EOF
        <!-- Our activity is a homebrewn variant of the NativeAcitivity.
             This will take care of integrating with our NDK code. -->
        <activity android:name=".Gforth_n2o"
                android:icon="@drawable/net2o_green"
                android:label="@string/net2o_app_name"
                android:windowAnimationStyle="@android:style/Animation.Activity"
		android:windowSoftInputMode="stateHidden|adjustResize"
                android:configChanges="orientation|screenSize|keyboardHidden"
                android:theme="@android:style/Theme.NoTitleBar"
                android:launchMode="singleTop">
................................................................................
                    android:value="net2o/startn2o.fs" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".Gforth_n2o_gui"
                android:icon="@drawable/net2o"
                android:label="@string/net2o_gui_name"
                android:windowAnimationStyle="@android:style/Animation.Activity"
		android:windowSoftInputMode="stateHidden|adjustResize"
                android:configChanges="orientation|screenSize|keyboardHidden"
                android:theme="@android:style/Theme.NoTitleBar"
                android:launchMode="singleTop">

Changes to gui.fs.

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
...
467
468
469
470
471
472
473

















474
475
476
477
478
479
480
481
482
483















484

485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
    pw-back >o to w-color o> ;
: size-limit ( -- )
    edit-w .text$ nip #800 u> IF
	prev-text$ edit-w >o to text$ o>
    THEN ;
: nick-filter ( -- ) edit-w >o
    0 >r BEGIN  text$ r@ safe/string  WHILE
	    c@ bl = IF
		addr text$ r@ 1 $del
		r@ curpos u< +to curpos
	    ELSE  r> 1+ >r  THEN  REPEAT  drop rdrop
    o> ;

glue new Constant glue*lll±
glue*lll± >o 1Mglue fnip 1000e fswap hglue-c glue! 0glue fnip 1filll fswap dglue-c glue! 1glue vglue-c glue! o>

................................................................................

: ?avatar ( addr u -- o / )
    key# #@ IF
	cell+ .ke-avatar $@ dup IF
	    show-avatar ?dup-0=-IF  THEN
	ELSE  2drop  THEN
    ELSE  drop  THEN ;


















: show-nick ( o:key -- )
    ke-imports @ [ 1 import#provisional lshift ]L and ?EXIT
    ke-imports @ >im-color# sfloats { ki }
    {{ glue*l imports#rgb-bg ki + sf@ slide-frame dup .button1
	{{
	    {{ \large imports#rgb-fg ki + sf@ to x-color
		ke-avatar $@ dup IF  show-avatar ?+avatars
		ELSE  2drop user-avatar avatar-thumb   THEN
		ke-sk sec@ nip IF  \bold  ELSE  \regular  THEN  \sans















		['] .nick-base $tmp }}text 25%b

		ke-pets[] $[]# IF
		    {{
			x-color glue*l pet-color x-color slide-frame dup .button3 to x-color
			['] .pet-base $tmp }}text 25%b
		    }}z
		THEN
	    glue*l }}glue }}h name-tab
	    {{
		{{ \sans \script ke-selfsig $@ ['] .sigdates $tmp }}text glue*l }}glue }}h
		{{ \mono \script ke-pk $@ key| ['] 85type $tmp }}text 20%bt glue*l }}glue }}h swap
	    }}v pk-tab
	glue*lll }}glue }}h
    }}z nick[]  \regular
    mykey-box nicks-box ke-sk sec@ nip select /flop .child+ ;

: fill-nicks ( -- )
    keys>sort[]
    key-list[] $@ bounds ?DO
	I @ .show-nick
    cell +LOOP ;







|
|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>









|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>






|




|
|







182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
...
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
    pw-back >o to w-color o> ;
: size-limit ( -- )
    edit-w .text$ nip #800 u> IF
	prev-text$ edit-w >o to text$ o>
    THEN ;
: nick-filter ( -- ) edit-w >o
    0 >r BEGIN  text$ r@ safe/string  WHILE
	    c@ dup bl = over '@' = or swap '#' = or
	    IF  addr text$ r@ 1 $del
		r@ curpos u< +to curpos
	    ELSE  r> 1+ >r  THEN  REPEAT  drop rdrop
    o> ;

glue new Constant glue*lll±
glue*lll± >o 1Mglue fnip 1000e fswap hglue-c glue! 0glue fnip 1filll fswap dglue-c glue! 1glue vglue-c glue! o>

................................................................................

: ?avatar ( addr u -- o / )
    key# #@ IF
	cell+ .ke-avatar $@ dup IF
	    show-avatar ?dup-0=-IF  THEN
	ELSE  2drop  THEN
    ELSE  drop  THEN ;

: edit-pen[] ( backframe edit-x update-xt -- xt )
    \G create a closure for an edit pen
    [{: backframe edit-x xt: upd :}d
	data >o edit-x .act IF  \ push back to default, grey out
	    edit-x >o act .dispose  0 to act o>
	    true upd
	    imports#rgb-fg sf@ transp#
	ELSE                    \ engage+select all+black text
	    edit-x o [: true ;] edit[]
	    ['] nick-filter filter[] drop
	    edit-x engage  false upd
	    imports#rgb-fg sf@ imports#rgb-bg sf@
	THEN
	backframe >o to frame-color o> to text-color
	o>
	+resize +sync ;] ;

: show-nick ( o:key -- )
    ke-imports @ [ 1 import#provisional lshift ]L and ?EXIT
    ke-imports @ >im-color# sfloats { ki }
    {{ glue*l imports#rgb-bg ki + sf@ slide-frame dup .button1
	{{
	    {{ \large imports#rgb-fg ki + sf@ to x-color
		ke-avatar $@ dup IF  show-avatar ?+avatars
		ELSE  2drop user-avatar avatar-thumb   THEN
		\sans  ke-sk sec@ nip IF
		    \bold
		    {{
			glue*l }}glue
			{{
			    glue*l transp# font-size# 40% f* }}frame dup .button3 dup { backframe }
			    {{
				['] .nick-base $tmp }}edit 25%b dup { edit-w }
				dup { edit-x }
				l" " black# }}button /hfix
				backframe edit-x [: drop ;] edit-pen[] edit-w click[]
			    }}h box[]
			}}z box[]
		    }}v box[] >o 0e to baseline 0e to gap o o>
		ELSE
		    \regular
		    ['] .nick-base $tmp }}text 25%b
		THEN
		ke-pets[] $[]# IF
		    {{
			x-color glue*l pet-color x-color slide-frame dup .button3 to x-color
			['] .pet-base $tmp }}text 25%b
		    }}z
		THEN
	    glue*l }}glue }}h name-tab box[]
	    {{
		{{ \sans \script ke-selfsig $@ ['] .sigdates $tmp }}text glue*l }}glue }}h
		{{ \mono \script ke-pk $@ key| ['] 85type $tmp }}text 20%bt glue*l }}glue }}h swap
	    }}v pk-tab
	glue*lll }}glue }}h box[]
    }}z box[]  \regular
    mykey-box nicks-box ke-sk sec@ nip select /flop .child+ ;

: fill-nicks ( -- )
    keys>sort[]
    key-list[] $@ bounds ?DO
	I @ .show-nick
    cell +LOOP ;

Changes to keys.fs.

1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420

Variable tries#
#10 Value maxtries#

forward read-chatgroups

: n2o-greeting ( -- )
    [:  ." net2o " (c) ."  2010-2020 Bernd Paysan" cr ;]
    do-debug ;

: get-skc ( -- )
    secret-keys# IF  read-chatgroups  EXIT  THEN
    n2o-greeting  tries# off
    debug-vector @ op-vector !@ >r <default>
    secret-keys#







|







1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420

Variable tries#
#10 Value maxtries#

forward read-chatgroups

: n2o-greeting ( -- )
    [:  ." net2o " net2o-version type space (c) ."  2010-2020 Bernd Paysan" cr ;]
    do-debug ;

: get-skc ( -- )
    secret-keys# IF  read-chatgroups  EXIT  THEN
    n2o-greeting  tries# off
    debug-vector @ op-vector !@ >r <default>
    secret-keys#

Changes to lang/de.

3
4
5
6
7
8
9

10
11
12
13
14
15
16
net2o GUI
Copyright © 2010–2020 Bernd Paysan
Falsche Passphrase
Zum Öffnen Passphrase eingeben
Erzeuge neue ID
Neue Passphrase eingeben
Neue Passphrase nochmal eingeben

Spitznamen
Öffentlicher Schlüssel
Schlüsselsignaturdatum
Meine Schlüssel
Meine Gruppen
Meine Freunde
Posting







>







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
net2o GUI
Copyright © 2010–2020 Bernd Paysan
Falsche Passphrase
Zum Öffnen Passphrase eingeben
Erzeuge neue ID
Neue Passphrase eingeben
Neue Passphrase nochmal eingeben

Spitznamen
Öffentlicher Schlüssel
Schlüsselsignaturdatum
Meine Schlüssel
Meine Gruppen
Meine Freunde
Posting

Changes to lang/en.

3
4
5
6
7
8
9

10
11
12
13
14
15
16
net2o GUI
Copyright © 2010–2020 Bernd Paysan
wrong passphrase!
Enter passphrase to unlock
Create new ID
Enter new passphrase
Enter new passphrase again

Nick+Pet
Pubkey
Key date
My key
My groups
My peers
Post







>







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
net2o GUI
Copyright © 2010–2020 Bernd Paysan
wrong passphrase!
Enter passphrase to unlock
Create new ID
Enter new passphrase
Enter new passphrase again

Nick+Pet
Pubkey
Key date
My key
My groups
My peers
Post

Changes to lang/zh.

3
4
5
6
7
8
9

10
11
12
13
14
15
16
net2o 图形用户界面
版权 © 2010–2020 Bernd Paysan
错误的密码
输入密码以解锁
创建新的ID
输入新的密码
再次输入新的密码

昵称
公钥
关键签名日期
我的钥匙
我的集团
我的朋友
贴子







>







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
net2o 图形用户界面
版权 © 2010–2020 Bernd Paysan
错误的密码
输入密码以解锁
创建新的ID
输入新的密码
再次输入新的密码

昵称
公钥
关键签名日期
我的钥匙
我的集团
我的朋友
贴子

Changes to msg.fs.

1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
....
1984
1985
1986
1987
1988
1989
1990

1991
1992
1993
1994
1995
1996
1997
    [: $@ >d#id >o dht-owner $[]# 0> IF
	    last# $free  last# cell+ $free
	    import#chat import-type !
	    64#-1 key-read-offset 64!
	    [: 0 dht-owner $[]@ 2dup sigsize# - forth:type
		dht-hash $. dup sigsize# - safe/string forth:type ;] $tmp
	    ['] read-pk2key$ catch IF  2drop  THEN
	ELSE  1+  THEN o> ;] #map ;
: fetch-pks ( o:peer-con -- )
    0 msg-group-o .msg:pks# [: drop 1+ ;] #map 0<>  IF
	o to connection
	0 0 { start requests }
	msg-group-o .msg:pks#
	addr start addr requests [{: start requests :}l
	    start @ 0= IF  net2o-code  expect-reply  THEN
................................................................................
: msg-timeout ( -- )
    packets2 @  connected-timeout  packets2 @ <>
    IF  reply( ." Resend to " pubkey $@ key>nick type cr )
	timeout-expired? IF
	    timeout( <err> ." Excessive timeouts from "
	    pubkey $@ key>nick type ." : "
	    ack@ .timeouts @ . <default> cr )

	    msg-group$ $@len IF
		msg-group-o ?dup-IF  .msg:mode dup @ msg:otr# or swap
		    [: pubkey $@ ['] left, send-avalanche ;] !wrapper
		THEN
	    THEN
	    net2o:dispose-context
	    EXIT







|







 







>







1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
....
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
    [: $@ >d#id >o dht-owner $[]# 0> IF
	    last# $free  last# cell+ $free
	    import#chat import-type !
	    64#-1 key-read-offset 64!
	    [: 0 dht-owner $[]@ 2dup sigsize# - forth:type
		dht-hash $. dup sigsize# - safe/string forth:type ;] $tmp
	    ['] read-pk2key$ catch IF  2drop  THEN
	THEN o> ;] #map ;
: fetch-pks ( o:peer-con -- )
    0 msg-group-o .msg:pks# [: drop 1+ ;] #map 0<>  IF
	o to connection
	0 0 { start requests }
	msg-group-o .msg:pks#
	addr start addr requests [{: start requests :}l
	    start @ 0= IF  net2o-code  expect-reply  THEN
................................................................................
: msg-timeout ( -- )
    packets2 @  connected-timeout  packets2 @ <>
    IF  reply( ." Resend to " pubkey $@ key>nick type cr )
	timeout-expired? IF
	    timeout( <err> ." Excessive timeouts from "
	    pubkey $@ key>nick type ." : "
	    ack@ .timeouts @ . <default> cr )
	    ungroup-ctx \ ungroup before sending avalanches!
	    msg-group$ $@len IF
		msg-group-o ?dup-IF  .msg:mode dup @ msg:otr# or swap
		    [: pubkey $@ ['] left, send-avalanche ;] !wrapper
		THEN
	    THEN
	    net2o:dispose-context
	    EXIT

Changes to startn2o.fs.

1
2
3
4
5
6
7
8
9
10
\ Start net2o on android

e? os-type s" linux-android" string-prefix? [IF] require starta.fs [THEN]
page ." loading n2o..."
warnings off \ no warnings please
require n2o.fs
: n2o-greet  page
    ." net2o " net2o-version type ."  text UI, nerd edition" cr
    ." type 'bye' to leave and 'help' for help" cr ;
:noname load-rc n2o-greet get-me save-net2o-cmds set-net2o-cmds ; is bootmessage






<
<
<
|
1
2
3
4
5
6



7
\ Start net2o on android

e? os-type s" linux-android" string-prefix? [IF] require starta.fs [THEN]
page ." loading n2o..."
warnings off \ no warnings please
require n2o.fs



:noname load-rc page get-me save-net2o-cmds set-net2o-cmds ; is bootmessage

Changes to startn2ogui.fs.

1
2
3
4
5
6
7
8
\ Start net2o on android

e? os-type s" linux-android" string-prefix? [IF] require starta.fs [THEN]
page ." loading n2o..."
warnings off \ no warnings please
require n2o.fs
page
:noname load-rc save-net2o-cmds set-net2o-cmds n2o:gui bye ; is bootmessage






<
|
1
2
3
4
5
6

7
\ Start net2o on android

e? os-type s" linux-android" string-prefix? [IF] require starta.fs [THEN]
page ." loading n2o..."
warnings off \ no warnings please
require n2o.fs

:noname load-rc page save-net2o-cmds set-net2o-cmds n2o:gui bye ; is bootmessage