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
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue