Skip to content

Conversation

@iequidoo
Copy link
Collaborator

@iequidoo iequidoo commented Dec 14, 2025

Also remove "you can now call 'configure'" from the REPL output, probably users of the REPL tool can read the code documentation to know when 'configure' should be run.
Close #7450

"setqr" => {
ensure!(!arg1.is_empty(), "Argument <qr-content> missing.");
match set_config_from_qr(&context, arg1).await {
Ok(()) => println!("Config set from QR code, you can now call 'configure'"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is actually a program output, but rather a log, so decided to move it to stderr

*
* Internally, the function will call dc_set_config() with the appropriate keys,
* e.g. `addr` and `mail_pw` for DC_QR_ACCOUNT and DC_QR_LOGIN.
* DC_QR_ACCOUNT and DC_QR_LOGIN QR codes configure the context.
Copy link
Contributor

@Simon-Laux Simon-Laux Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from reading this the change is not clear to me, I think these additions to the docs should also explain relation to add_transport_from_qr api. (not specific to cffi, maybe more a jsonrpc/rust api question, cffi doesn't seem to contain that new api)

Copy link
Collaborator Author

@iequidoo iequidoo Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from reading this the change is not clear to me

There's no change, it's a (almost) pure doc PR, but i meant that DC_QR_ACCOUNT and DC_QR_LOGIN QR codes configure the context if it wasn't configured before. Feel free to rephrase.

As for add_transport_from_qr(), it's indeed only in JSON-RPC and in case of the mentioned QR codes it has the same effect as set_config_from_qr(), so it makes sense to add a cross-reference between them. And IIUC both functions are valid and not deprecated for the mentioned QR codes.

EDIT: The difference is that set_config_from_qr() doesn't restart IO, it fails instead if IO is started.

…CLOGIN:" QRs (#7450)

Also remove "you can now call 'configure'" from the REPL output, probably users of the REPL tool can
read the code documentation to know when 'configure' should be run.
@iequidoo iequidoo force-pushed the iequidoo/set_config_from_qr-doc branch from 1a79c20 to 061b275 Compare December 16, 2025 07:51
@iequidoo iequidoo requested a review from Simon-Laux December 16, 2025 07:51
Copy link
Contributor

@Simon-Laux Simon-Laux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is an improvement already, even though I'm still a little confused when reading it (but maybe that's just me).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REPL tells to run configure after setqr dcaccount:

3 participants