Commit 1030c197 authored by bernd's avatar bernd

Runs on Android with some minor bugs

parent c356fa34
......@@ -15,7 +15,7 @@ UValue test# 0 to test#
: >cache ( addr u -- addr' u' ) [: ." .cache" .test# ." /" type ;] $tmp ;
: init-cache' ( -- )
"" >cache 1- file-status nip #-514 = IF
"" >cache 1- file-status nip no-file# = IF
"" >cache 1- $1FF =mkdir throw
THEN ;
......
......@@ -42,12 +42,12 @@ Variable replay-mode
: >chatid ( group u -- id u ) lastkey@ keyed-hash#128 ;
: save-msgs ( group u -- )
otr-mode @ replay-mode @ or IF 2drop EXIT THEN init-chatlog
enc-file $off n2o:new-msg >o
otr-mode @ replay-mode @ or IF 2drop EXIT THEN
init-chatlog enc-file $off n2o:new-msg >o
2dup msg-logs #@ bounds ?DO
I $@ [: net2o-base:$, net2o-base:nestsig ;]
gen-cmd$ enc-file $+!
cell +LOOP dispose o>
cell +LOOP dispose o>
>chatid
[: ." ~/.net2o/chats/" 85type ;] $tmp enc-filename $!
pk-off key-list encfile-rest ;
......@@ -58,7 +58,7 @@ Variable replay-mode
: load-msg ( group u -- )
>chatid [: ." ~/.net2o/chats/" 85type ." .v2o" ;] $tmp
2dup file-status nip #-514 = ?EXIT
2dup file-status nip no-file# = ?EXIT
vault>msg decrypt-file
replay-mode off ;
......@@ -316,7 +316,7 @@ set-current previous
bl $split 2swap 1 /string ':' -skip nick>pk \ 0. if no nick
2dup d0= IF 2drop 2drop oaddr ou true
ELSE $, msg-signal false THEN
UNTIL THEN THEN
UNTIL THEN THEN
$, msg-text ;] send-avalanche .chat ;
previous
......
......@@ -426,7 +426,9 @@ $10 Constant datesize#
\ copy files
: throw?exists ( throwcode -- ) dup #-514 <> and throw ;
#-514 Constant no-file#
: throw?exists ( throwcode -- ) dup no-file# <> and throw ;
: >backup ( addr u -- )
2dup 2dup [: type '~' emit ;] $tmp rename-file throw?exists
......@@ -437,7 +439,7 @@ $10 Constant datesize#
: >copy ( addr u -- fd )
2dup >new { fd1 }
r/o open-file dup #-514 = IF
r/o open-file dup no-file# = IF
2drop
ELSE
throw 0 { fd0 w^ cpy }
......
......@@ -110,7 +110,7 @@ Variable key-list
vaultkey $100 erase
enc-mode @ $FF and $20 - rng$ vkey state# move-rep
key( ." vkey: " vkey state# 85type forth:cr )
enc-mode @ dup lit, vault-crypt 8 rshift $FF and >crypt
enc-mode @ dup ulit, vault-crypt 8 rshift $FF and >crypt
[: [: drop vsk swap keygendh ed-dh 2>r
vkey vaultkey $10 + enc-mode @ $FF and $20 - move
vaultkey enc-mode @ $FF and 2r> encrypt$
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment