added messaging hook #1798

v1.18.x
barisusakli 11 years ago
parent 75bf9e62be
commit 0f5c1d1892

@ -94,6 +94,9 @@ Executed when a post or signature needs to be parsed from raw text to HTML (for
``filter:post.parse`` ``filter:post.parse``
^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
``filter:messaging.save``
^^^^^^^^^^^^^^^^^^^^^^^^
``filter:messaging.parse`` ``filter:messaging.parse``
^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^

@ -28,6 +28,11 @@ var db = require('./database'),
touid: touid touid: touid
}; };
plugins.fireHook('filter:messaging.save', message, function(err, message) {
if (err) {
return callback(err);
}
db.setObject('message:' + mid, message, function(err) { db.setObject('message:' + mid, message, function(err) {
if (err) { if (err) {
return callback(err); return callback(err);
@ -43,6 +48,7 @@ var db = require('./database'),
}); });
}); });
}); });
});
}; };
Messaging.getMessages = function(fromuid, touid, isNew, callback) { Messaging.getMessages = function(fromuid, touid, isNew, callback) {

Loading…
Cancel
Save