added new hook and method for plugins to introduce their own formatting options, #2743

This commit is contained in:
Julian Lam
2015-02-19 16:51:10 -05:00
parent 767816e669
commit ceb18fe73d
3 changed files with 42 additions and 62 deletions

View File

@@ -114,6 +114,16 @@ SocketModules.composer.stopNotifyTyping = function(socket, data) {
server.in('topic_' + data.tid).emit('event:topic.stopNotifyTyping', data);
};
SocketModules.composer.getFormattingOptions = function(socket, data, callback) {
plugins.fireHook('filter:composer.formatting', {
options: [
// { className: 'fa fa-bold' } Just an example of what needs to be set via plugins
]
}, function(err, payload) {
callback(err, payload.options);
});
};
/* Chat */
SocketModules.chats.get = function(socket, data, callback) {