added messaging hook #1798

This commit is contained in:
barisusakli
2014-07-09 12:43:02 -04:00
parent 75bf9e62be
commit 0f5c1d1892
2 changed files with 15 additions and 6 deletions

View File

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

View File

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