mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-04 18:29:19 +02:00
add a cli command to get a qr code with a bad fingerprint
This commit is contained in:
parent
0465489e9f
commit
eded27ba32
2 changed files with 6 additions and 1 deletions
|
@ -480,6 +480,8 @@ char* mrmailbox_cmdline(mrmailbox_t* mailbox, const char* cmdline)
|
||||||
"delcontact <contact-id>\n"
|
"delcontact <contact-id>\n"
|
||||||
"cleanupcontacts\n"
|
"cleanupcontacts\n"
|
||||||
"======================================Misc.==\n"
|
"======================================Misc.==\n"
|
||||||
|
"getqr\n"
|
||||||
|
"getbadqr\n"
|
||||||
"checkqr <qr-contenct>\n"
|
"checkqr <qr-contenct>\n"
|
||||||
"event <event-id to test>\n"
|
"event <event-id to test>\n"
|
||||||
"fileinfo <file>\n"
|
"fileinfo <file>\n"
|
||||||
|
|
|
@ -157,9 +157,12 @@ int main(int argc, char ** argv)
|
||||||
printf("\n\n\n\n"); /* insert some blank lines to visualize the break in the buffer */
|
printf("\n\n\n\n"); /* insert some blank lines to visualize the break in the buffer */
|
||||||
printf("\e[1;1H\e[2J"); /* should work on ANSI terminals and on Windows 10. If not, well, then not. */
|
printf("\e[1;1H\e[2J"); /* should work on ANSI terminals and on Windows 10. If not, well, then not. */
|
||||||
}
|
}
|
||||||
else if( strcmp(cmd, "getqr")==0 )
|
else if( strcmp(cmd, "getqr")==0 || strcmp(cmd, "getbadqr")==0 )
|
||||||
{
|
{
|
||||||
char* qrstr = mrmailbox_get_qr(mailbox);
|
char* qrstr = mrmailbox_get_qr(mailbox);
|
||||||
|
if( strcmp(cmd, "getbadqr")==0 && strlen(qrstr)>40 ) {
|
||||||
|
for( int i = 12; i < 22; i++ ) { qrstr[i] = '0'; }
|
||||||
|
}
|
||||||
printf("%s\n", qrstr);
|
printf("%s\n", qrstr);
|
||||||
char* syscmd = mr_mprintf("qrencode -t UTF8 \"%s\" -o -", qrstr);
|
char* syscmd = mr_mprintf("qrencode -t UTF8 \"%s\" -o -", qrstr);
|
||||||
system(syscmd);
|
system(syscmd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue