diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index bdf0b56afd..4f5c6c001f 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -14701,6 +14701,13 @@ api.wrap = function(user, main) { } return typeof cb === "function" ? cb(null, user.preferences.webhooks) : void 0; }, + clearPMs: function(req, cb) { + user.inbox.messages = {}; + if (typeof user.markModified === "function") { + user.markModified('inbox.messages'); + } + return typeof cb === "function" ? cb(null, user.inbox.messages) : void 0; + }, deletePM: function(req, cb) { delete user.inbox.messages[req.params.id]; if (typeof user.markModified === "function") { diff --git a/script/index.coffee b/script/index.coffee index 63ebe06a24..3bb61d2993 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -628,6 +628,10 @@ api.wrap = (user, main=true) -> # ------ # Inbox # ------ + clearPMs: (req, cb) -> + user.inbox.messages = {} + user.markModified? 'inbox.messages' + cb? null, user.inbox.messages deletePM: (req, cb) -> delete user.inbox.messages[req.params.id] user.markModified? 'inbox.messages.'+req.params.id