Rename hooks

Add `static:messaging.canMessageRoom` as well
v1.18.x
Peter Jaszkowiak 8 years ago
parent 19d6386237
commit 033ce02e7b

@ -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);
};

@ -130,7 +130,7 @@ module.exports = function (Messaging) {
}
},
function (messages, next) {
plugins.fireHook('filter:messaging.getMessagesData', {
plugins.fireHook('filter:messaging.getMessages', {
messages: messages,
uid: uid,
roomId: roomId,

@ -28,7 +28,7 @@ module.exports = function (Messaging) {
message: messageObj,
};
plugins.fireHook('filter:messaging.notifyUsersInRoom', data, next);
plugins.fireHook('filter:messaging.notify', data, next);
},
function (data, next) {
if (!data || !data.uids || !data.uids.length) {

Loading…
Cancel
Save