Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
- fixed bug in --log-level : now RUST_LOG is appropriately used as default
- fixed bug --verify, --verify emoji improved, --verify emoji-req works on Element Web app but still does not work on Element Android app
  • Loading branch information
8go committed Sep 14, 2024
1 parent 1fc5f9a commit 2836a28
Show file tree
Hide file tree
Showing 11 changed files with 472 additions and 318 deletions.
166 changes: 100 additions & 66 deletions Cargo.lock

Large diffs are not rendered by default.

22 changes: 17 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "matrix-commander"
version = "0.7.0"
version = "0.8.0"
edition = "2021"
description = "simple but convenient CLI-based Matrix client app for sending and receiving"
documentation = "https://docs.rs/matrix-commander"
Expand All @@ -18,13 +18,22 @@ publish = true


[dependencies]
clap = { version = "4.5", features = ["derive", "color", "wrap_help", "unicode"] }
clap = { version = "4.5", features = [
"derive",
"color",
"wrap_help",
"unicode",
] }
colored = "2.1"
directories = "5.0"
futures-util = "0.3"
json = "0.12"
# matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk , features = ["markdown", "anyhow"] }
matrix-sdk = { version = "0.7", features = ["markdown", "anyhow", "bundled-sqlite"] }
matrix-sdk = { version = "0.7", features = [
"markdown",
"anyhow",
"bundled-sqlite",
] }
mime = "0.3"
mime_guess = "2.0"
regex = "1.10"
Expand All @@ -33,9 +42,12 @@ rpassword = "7.3"
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
thiserror = "1.0"
tokio = { version = "1.40", default-features = false, features = ["rt-multi-thread", "macros",] }
tokio = { version = "1.40", default-features = false, features = [
"rt-multi-thread",
"macros",
] }
tracing = "0.1"
tracing-subscriber = "0.3"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
update-informer = "1.1"
url = { version = "2.5", features = ["serde"] }

Expand Down
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ Options:
--log-level <LOG_LEVEL>
Set the log level by overwriting the default log level. Details:: If
not used, then the default log level set with environment variable
'RUST_LOG' will be used. See also '--debug' and '--verbose'
'RUST_LOG' will be used. See also '--debug' and '--verbose'. An
example use of RUST_LOG is to use neither --log-level nor --debug,
and to set RUST_LOG="error,matrix_commander_rs=debug" which turns off
debugging on all lower level modules and turns debugging on only for
matrix-commander-rs
[default: none]
Expand Down Expand Up @@ -254,7 +258,15 @@ Options:
--verify <VERIFICATION_METHOD>
Perform account verification. Details:: By default, no verification
is performed. Verification is currently offered via Manual-Device,
Manual-User, Emoji and Emoji-Req. Manual verification is simpler but
Manual-User, Emoji and Emoji-Req. Do verification in this order: 1)
bottstrap first with -bootstrap, 2) perform both manual
verifications, and 3) perform emoji verification. --verify emoji has
been tested against Element in Firefox browser and against Element
app on Android phone. Both has been working successfully in Sept
2024. In Element web page it was important NOT to click the device in
the device list, but to click the underscored link "Verify" just
above the device list. In the Element on cell phone case, accept the
emojis first on the cell phone. Manual verification is simpler but
does less. Try: '--bootstrap --password mypassword --verify
manual-device' or '--bootstrap --password mypassword --verify
manual-user'. Manual only verfies devices or users one-directionally.
Expand All @@ -263,14 +275,16 @@ Options:
and
https://docs.rs/matrix-sdk/0.7/matrix_sdk/encryption/identities/struct.UserIdentity.html#method.verify
for more info on Manual verification. manual-device can only verify
its own devices, notother users' devices. manual-user can trust other
users. So, with verify-user also use the --user option to specify one
or multiple users. One can first do 'manual-device' and 'manual-user'
verification and then 'emoji' or 'emoji-req' verification. Both
'emoji' as well as 'emoji-req' perform emoji verification. With
'emoji' we send a request to some other client to request
verification from their device. With 'emoji-req' we wait for some
other client to request verification from us. If verification is
its own devices, not other users' devices. manual-user can trust
other users. So, with manual-user also use the --user option to
specify one or multiple users. With manual-user first trust yourself,
by setting --user to yourself, or omitting -user in which case it
will default to itself. One should first do 'manual-device' and
'manual-user' verification and then 'emoji' or 'emoji-req'
verification. Both 'emoji' as well as 'emoji-req' perform emoji
verification. With 'emoji' we send a request to some other client to
request verification from their device. With 'emoji-req' we wait for
some other client to request verification from us. If verification is
desired, run this program in the foreground (not as a service) and
without a pipe. While verification is optional it is highly
recommended, and it is recommended to be done right after (or
Expand Down Expand Up @@ -299,8 +313,9 @@ Options:
similar. You must specify a user with --user and a device with
--device to specify to which device you want to send the verification
request. On the other device you get a pop up and you must accept the
verification request. 'emoji-req' seems to have problems, e.g.
'emoji-req' does not seem to work with Element phone app
verification request. 'emoji-req' currently seems to have problems,
while it does work with Element web page in browser, 'emoji-req' does
not seem to work with Element phone app
[default: none]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.0
0.8.0
10 changes: 6 additions & 4 deletions help.help.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Welcome to "matrix-commander-rs", a Matrix CLI client. ─── On the first run use
--login to log in, to authenticate. On the second run we suggest to use
--verify to get verified. Manual verification is built-in and can be used to
verify devices. Or combine both --login and --verify in the first run. On
further runs "matrix-commander-rs" implements a simple Matrix CLI client that
can send messages or files, listen to messages, operate on rooms, etc. ───
─── This project is currently only a vision. The Python package
verify devices and users. Or combine both --login and --verify in the first
run. On further runs "matrix-commander-rs" implements a simple Matrix CLI
client that can send messages or files, listen to messages, operate on rooms,
etc. ─── ─── This project is currently only a vision. The Python package
"matrix-commander" exists. The vision is to have a compatible program in Rust.
I cannot do it myself, but I can coordinate and merge your pull requests. Have
a look at the repo "https://github.com/8go/matrix-commander-rs/". Please help!
Expand Down Expand Up @@ -163,5 +163,7 @@ Options:
repository.
--media-mxc-to-http [<MXC_URI>...]
Convert URIs to HTTP URLs.
--get-masterkey
Get your own master key.
PS: Also have a look at scripts/matrix-commander-rs-tui.
Use --manual to get more detailed help information.
39 changes: 27 additions & 12 deletions help.manual.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ Options:
--log-level <LOG_LEVEL>
Set the log level by overwriting the default log level. Details:: If
not used, then the default log level set with environment variable
'RUST_LOG' will be used. See also '--debug' and '--verbose'
'RUST_LOG' will be used. See also '--debug' and '--verbose'. An
example use of RUST_LOG is to use neither --log-level nor --debug,
and to set RUST_LOG="error,matrix_commander_rs=debug" which turns off
debugging on all lower level modules and turns debugging on only for
matrix-commander-rs

[default: none]

Expand Down Expand Up @@ -144,7 +148,15 @@ Options:
--verify <VERIFICATION_METHOD>
Perform account verification. Details:: By default, no verification
is performed. Verification is currently offered via Manual-Device,
Manual-User, Emoji and Emoji-Req. Manual verification is simpler but
Manual-User, Emoji and Emoji-Req. Do verification in this order: 1)
bottstrap first with -bootstrap, 2) perform both manual
verifications, and 3) perform emoji verification. --verify emoji has
been tested against Element in Firefox browser and against Element
app on Android phone. Both has been working successfully in Sept
2024. In Element web page it was important NOT to click the device in
the device list, but to click the underscored link "Verify" just
above the device list. In the Element on cell phone case, accept the
emojis first on the cell phone. Manual verification is simpler but
does less. Try: '--bootstrap --password mypassword --verify
manual-device' or '--bootstrap --password mypassword --verify
manual-user'. Manual only verfies devices or users one-directionally.
Expand All @@ -153,14 +165,16 @@ Options:
and
https://docs.rs/matrix-sdk/0.7/matrix_sdk/encryption/identities/struct.UserIdentity.html#method.verify
for more info on Manual verification. manual-device can only verify
its own devices, notother users' devices. manual-user can trust other
users. So, with verify-user also use the --user option to specify one
or multiple users. One can first do 'manual-device' and 'manual-user'
verification and then 'emoji' or 'emoji-req' verification. Both
'emoji' as well as 'emoji-req' perform emoji verification. With
'emoji' we send a request to some other client to request
verification from their device. With 'emoji-req' we wait for some
other client to request verification from us. If verification is
its own devices, not other users' devices. manual-user can trust
other users. So, with manual-user also use the --user option to
specify one or multiple users. With manual-user first trust yourself,
by setting --user to yourself, or omitting -user in which case it
will default to itself. One should first do 'manual-device' and
'manual-user' verification and then 'emoji' or 'emoji-req'
verification. Both 'emoji' as well as 'emoji-req' perform emoji
verification. With 'emoji' we send a request to some other client to
request verification from their device. With 'emoji-req' we wait for
some other client to request verification from us. If verification is
desired, run this program in the foreground (not as a service) and
without a pipe. While verification is optional it is highly
recommended, and it is recommended to be done right after (or
Expand Down Expand Up @@ -189,8 +203,9 @@ Options:
similar. You must specify a user with --user and a device with
--device to specify to which device you want to send the verification
request. On the other device you get a pop up and you must accept the
verification request. 'emoji-req' seems to have problems, e.g.
'emoji-req' does not seem to work with Element phone app
verification request. 'emoji-req' currently seems to have problems,
while it does work with Element web page in browser, 'emoji-req' does
not seem to work with Element phone app

[default: none]

Expand Down
1 change: 1 addition & 0 deletions help.usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ Options:
--mime [<MIME_TYPE>...]
--media-delete [<MXC_URI>...]
--media-mxc-to-http [<MXC_URI>...]
--get-masterkey
2 changes: 1 addition & 1 deletion scripts/workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ done

PS3='Please enter your choice: '
OPT1="git status # what is the current status"
OPT2="git add Cargo.lock Cargo.toml README.md VERSION help.manual.txt src/main.rs src/mclient.rs"
OPT2="git add Cargo.lock Cargo.toml README.md VERSION help.manual.txt help.help.txt help.usage.txt src/emoji_verify.rs src/main.rs src/mclient.rs"
OPT3="cargo package --list # show files containing changes"
OPTC="Continue"
OPTQ="Quit"
Expand Down
Loading

0 comments on commit 2836a28

Please sign in to comment.