From 1a66d1853762f191f48d1a9038abce3dc42dd8b1 Mon Sep 17 00:00:00 2001 From: Tristan Matthews Date: Tue, 1 Oct 2013 21:33:08 -0400 Subject: [PATCH] js: allow plugins to declare themselves as exclusive handlers --- js/websockets.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/websockets.js b/js/websockets.js index 40d1381..fd29ad9 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -118,6 +118,10 @@ weechat.factory('pluginManager', ['youtubePlugin', 'urlPlugin', 'imagePlugin', f if (pluginContent) { var pluginContent = {'visible': false, 'content': pluginContent } content.push(pluginContent); + + if (plugins[i].exclusive) { + break; + } } } @@ -143,7 +147,8 @@ weechat.factory('youtubePlugin', [function() { } return { - contentForMessage: contentForMessage + contentForMessage: contentForMessage, + exclusive: true } }]); @@ -158,7 +163,8 @@ weechat.factory('urlPlugin', [function() { } return { - contentForMessage: contentForMessage + contentForMessage: contentForMessage, + exclusive: false } }]);