Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Commit

Permalink
add option to empty folder on server to cmdline
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed Jun 21, 2019
1 parent 2d8765e commit 2ddb5d2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cmdline/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ char* dc_cmdline(dc_context_t* context, const char* cmdline)
"checkqr <qr-content>\n"
"event <event-id to test>\n"
"fileinfo <file>\n"
"emptyserver [mvbox|inbox]\n"
"clear -- clear screen\n" /* must be implemented by the caller */
"exit\n" /* must be implemented by the caller */
"============================================="
Expand Down Expand Up @@ -1345,6 +1346,21 @@ char* dc_cmdline(dc_context_t* context, const char* cmdline)
ret = dc_strdup("ERROR: Argument <file> missing.");
}
}
else if (strcmp(cmd, "emptyserver")==0)
{
int flags = 0;
if (arg1) {
if (strstr(arg1, "mvbox")!=NULL) { flags|= DC_EMPTY_MVBOX; }
if (strstr(arg1, "inbox")!=NULL) { flags|= DC_EMPTY_INBOX; }
}
if (flags) {
dc_empty_server(context, flags);
ret = COMMAND_SUCCEEDED;
}
else {
ret = dc_strdup("ERROR: Argument [mvbox|inbox] missing.");
}
}
else
{
ret = COMMAND_UNKNOWN;
Expand Down

0 comments on commit 2ddb5d2

Please sign in to comment.