mirror of
https://github.com/meganz/MEGAcmd
synced 2025-08-29 12:57:44 +00:00
added alerts command that displays the title of user alerts
This commit is contained in:
parent
baade360b9
commit
8fea526fc9
@ -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",
|
"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",
|
"showpcr", "users", "speedlimit", "killsession", "whoami", "help", "passwd", "reload", "logout", "version", "quit",
|
||||||
"thumbnail", "preview", "find", "completion", "clear", "https", "transfers", "exclude", "exit", "errorcode", "graphics",
|
"thumbnail", "preview", "find", "completion", "clear", "https", "transfers", "exclude", "exit", "errorcode", "graphics",
|
||||||
"cancel", "confirmcancel", "cat"
|
"cancel", "confirmcancel", "cat", "alerts"
|
||||||
#ifdef HAVE_LIBUV
|
#ifdef HAVE_LIBUV
|
||||||
, "webdav", "ftp"
|
, "webdav", "ftp"
|
||||||
#endif
|
#endif
|
||||||
|
@ -7977,6 +7977,24 @@ void MegaCmdExecuter::executecommand(vector<string> words, map<string, int> *clf
|
|||||||
|
|
||||||
return;
|
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")
|
else if (words[0] == "export")
|
||||||
{
|
{
|
||||||
if (!api->isFilesystemAvailable())
|
if (!api->isFilesystemAvailable())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user