mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
added a hook to post image upload for starters, more coming
This commit is contained in:
@@ -396,6 +396,10 @@ var db = require('./database'),
|
|||||||
|
|
||||||
Posts.uploadPostImage = function(image, callback) {
|
Posts.uploadPostImage = function(image, callback) {
|
||||||
|
|
||||||
|
if(plugins.hasListeners('filter:post.upload')) {
|
||||||
|
plugins.fireHook('filter:post.upload', image, callback);
|
||||||
|
} else {
|
||||||
|
|
||||||
if(meta.config.imgurClientID) {
|
if(meta.config.imgurClientID) {
|
||||||
if(!image || !image.data) {
|
if(!image || !image.data) {
|
||||||
return callback(new Error('invalid image'));
|
return callback(new Error('invalid image'));
|
||||||
@@ -417,6 +421,7 @@ var db = require('./database'),
|
|||||||
callback(new Error('Uploads are disabled!'));
|
callback(new Error('Uploads are disabled!'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Posts.uploadPostFile = function(file, callback) {
|
Posts.uploadPostFile = function(file, callback) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user