diff --git a/src/megacmd.cpp b/src/megacmd.cpp index ef2be54a..2c899d88 100644 --- a/src/megacmd.cpp +++ b/src/megacmd.cpp @@ -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 diff --git a/src/megacmdexecuter.cpp b/src/megacmdexecuter.cpp index b4be1986..d6f68667 100644 --- a/src/megacmdexecuter.cpp +++ b/src/megacmdexecuter.cpp @@ -7977,6 +7977,24 @@ void MegaCmdExecuter::executecommand(vector words, map *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())