mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-04 18:29:19 +02:00
the the 'getqr' command to the commandline; the command displays the qr code in the shell
This commit is contained in:
parent
5b80e99aa7
commit
0465489e9f
2 changed files with 13 additions and 0 deletions
|
@ -1162,6 +1162,10 @@ char* mrmailbox_cmdline(mrmailbox_t* mailbox, const char* cmdline)
|
|||
* Misc.
|
||||
******************************************************************************/
|
||||
|
||||
else if( strcmp(cmd, "getqr")==0 )
|
||||
{
|
||||
ret = mrmailbox_get_qr(mailbox);
|
||||
}
|
||||
else if( strcmp(cmd, "checkqr")==0 )
|
||||
{
|
||||
if( arg1 ) {
|
||||
|
|
|
@ -157,6 +157,15 @@ 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 )
|
||||
{
|
||||
char* qrstr = mrmailbox_get_qr(mailbox);
|
||||
printf("%s\n", qrstr);
|
||||
char* syscmd = mr_mprintf("qrencode -t UTF8 \"%s\" -o -", qrstr);
|
||||
system(syscmd);
|
||||
free(syscmd);
|
||||
free(qrstr);
|
||||
}
|
||||
else if( strcmp(cmd, "exit")==0 )
|
||||
{
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue