mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
feat(private-messages): add a "clear all" fn
This commit is contained in:
parent
1bca160eb6
commit
03f47cd0aa
2 changed files with 11 additions and 0 deletions
7
dist/habitrpg-shared.js
vendored
7
dist/habitrpg-shared.js
vendored
|
|
@ -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") {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue