1
0
Fork 0
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:
B. Petersen 2018-03-20 21:30:52 +01:00
parent 0465489e9f
commit eded27ba32
2 changed files with 6 additions and 1 deletions

View file

@ -480,6 +480,8 @@ char* mrmailbox_cmdline(mrmailbox_t* mailbox, const char* cmdline)
"delcontact <contact-id>\n"
"cleanupcontacts\n"
"======================================Misc.==\n"
"getqr\n"
"getbadqr\n"
"checkqr <qr-contenct>\n"
"event <event-id to test>\n"
"fileinfo <file>\n"

View file

@ -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("\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);
if( strcmp(cmd, "getbadqr")==0 && strlen(qrstr)>40 ) {
for( int i = 12; i < 22; i++ ) { qrstr[i] = '0'; }
}
printf("%s\n", qrstr);
char* syscmd = mr_mprintf("qrencode -t UTF8 \"%s\" -o -", qrstr);
system(syscmd);