mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 17:56:16 +01:00
added messaging hook #1798
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user