From ceb31c1947714b51f4ab4b13505ad35a45e9e7de Mon Sep 17 00:00:00 2001 From: David Cormier Date: Fri, 25 Jul 2014 17:32:55 -0400 Subject: [PATCH] contentForMessage doesn't have to care about content visibility --- js/glowingbear.js | 2 +- js/plugins.js | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 4dbae7b..66d8511 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -63,7 +63,7 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', function buffer.requestedLines++; // Only react to line if its displayed if (message.displayed) { - message = plugins.PluginManager.contentForMessage(message, $rootScope.visible); + message = plugins.PluginManager.contentForMessage(message); buffer.addLine(message); if (manually) { diff --git a/js/plugins.js b/js/plugins.js index eba813d..9e7f30b 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -53,7 +53,7 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) { * Iterates through all the registered plugins * and run their contentForMessage function. */ - var contentForMessage = function(message, visible) { + var contentForMessage = function(message) { message.metadata = []; for (var i = 0; i < plugins.length; i++) { @@ -66,10 +66,9 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) { var pluginContent = plugins[i].contentForMessage(message.text); if (pluginContent) { - pluginContent = {'visible': visible, - 'content': $sce.trustAsHtml(pluginContent), - 'nsfw': nsfw, - 'name': plugins[i].name }; + pluginContent = {'content': $sce.trustAsHtml(pluginContent), + 'nsfw': nsfw, + 'name': plugins[i].name }; message.metadata.push(pluginContent);