Rename hooks

Add `static:messaging.canMessageRoom` as well
This commit is contained in:
Peter Jaszkowiak
2017-04-26 15:22:17 -06:00
parent 19d6386237
commit 033ce02e7b
3 changed files with 9 additions and 4 deletions

View File

@@ -264,7 +264,7 @@ Messaging.canMessageUser = function (uid, toUid, callback) {
return next(new Error('[[error:chat-restricted]]'));
}
plugins.fireHook('filter:messaging.canMessageUser', {
plugins.fireHook('static:messaging.canMessageUser', {
uid: uid,
toUid: toUid,
}, function (err) {
@@ -306,7 +306,12 @@ Messaging.canMessageRoom = function (uid, roomId, callback) {
return next(new Error('[[error:email-not-confirmed-chat]]'));
}
next();
plugins.fireHook('static:messaging.canMessageRoom', {
uid: uid,
roomId: roomId,
}, function (err) {
next(err);
});
},
], callback);
};