contentForMessage doesn't have to care about content visibility
This commit is contained in:
parent
d2a30c1d13
commit
ceb31c1947
2 changed files with 5 additions and 6 deletions
|
@ -63,7 +63,7 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', function
|
||||||
buffer.requestedLines++;
|
buffer.requestedLines++;
|
||||||
// Only react to line if its displayed
|
// Only react to line if its displayed
|
||||||
if (message.displayed) {
|
if (message.displayed) {
|
||||||
message = plugins.PluginManager.contentForMessage(message, $rootScope.visible);
|
message = plugins.PluginManager.contentForMessage(message);
|
||||||
buffer.addLine(message);
|
buffer.addLine(message);
|
||||||
|
|
||||||
if (manually) {
|
if (manually) {
|
||||||
|
|
|
@ -53,7 +53,7 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) {
|
||||||
* Iterates through all the registered plugins
|
* Iterates through all the registered plugins
|
||||||
* and run their contentForMessage function.
|
* and run their contentForMessage function.
|
||||||
*/
|
*/
|
||||||
var contentForMessage = function(message, visible) {
|
var contentForMessage = function(message) {
|
||||||
|
|
||||||
message.metadata = [];
|
message.metadata = [];
|
||||||
for (var i = 0; i < plugins.length; i++) {
|
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);
|
var pluginContent = plugins[i].contentForMessage(message.text);
|
||||||
if (pluginContent) {
|
if (pluginContent) {
|
||||||
pluginContent = {'visible': visible,
|
pluginContent = {'content': $sce.trustAsHtml(pluginContent),
|
||||||
'content': $sce.trustAsHtml(pluginContent),
|
'nsfw': nsfw,
|
||||||
'nsfw': nsfw,
|
'name': plugins[i].name };
|
||||||
'name': plugins[i].name };
|
|
||||||
|
|
||||||
message.metadata.push(pluginContent);
|
message.metadata.push(pluginContent);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue