2
0
mirror of https://github.com/meganz/MEGAcmd synced 2025-08-22 01:47:24 +00:00

added alerts command that displays the title of user alerts

This commit is contained in:
Pablo Martin 2018-10-30 11:09:48 +01:00
parent baade360b9
commit 8fea526fc9
No known key found for this signature in database
GPG Key ID: 1746978B12F13D6E
2 changed files with 19 additions and 1 deletions

View File

@ -220,7 +220,7 @@ string avalidCommands [] = { "login", "signup", "confirm", "session", "mount", "
"put", "get", "attr", "userattr", "mkdir", "rm", "du", "mv", "cp", "sync", "export", "share", "invite", "ipc",
"showpcr", "users", "speedlimit", "killsession", "whoami", "help", "passwd", "reload", "logout", "version", "quit",
"thumbnail", "preview", "find", "completion", "clear", "https", "transfers", "exclude", "exit", "errorcode", "graphics",
"cancel", "confirmcancel", "cat"
"cancel", "confirmcancel", "cat", "alerts"
#ifdef HAVE_LIBUV
, "webdav", "ftp"
#endif

View File

@ -7977,6 +7977,24 @@ void MegaCmdExecuter::executecommand(vector<string> words, map<string, int> *clf
return;
}
else if (words[0] == "alerts")
{
MegaUserAlertList *uas = api->getUserAlerts();
if (uas)
{
for (int i = 0; i < uas->size(); i++)
{
MegaUserAlert * ua = uas->get(i);
OUTSTREAM << ua->getTypeString() << "\t" << ua->getTitle() << endl;
}
delete uas;
}
else
{
setCurrentOutCode(MCMD_EUNEXPECTED);
LOG_err << "No User Alerts List";
}
}
else if (words[0] == "export")
{
if (!api->isFilesystemAvailable())