diff --git a/index.html b/index.html index 773c267..23b329b 100644 --- a/index.html +++ b/index.html @@ -334,7 +334,7 @@ npm run build-electron-{windows, darwin, linux} - <>
diff --git a/js/inputbar.js b/js/inputbar.js index 52d1504..2d6054a 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -208,7 +208,12 @@ weechat.directive('inputBar', function() { }; //XXX THIS DOES NOT BELONG HERE! - $rootScope.addMention = function(prefix) { + $rootScope.addMention = function(bufferline) { + if (!bufferline.showHiddenBrackets) { + // the line is a notice or action or something else that doesn't belong + return; + } + var prefix = bufferline.prefix; // Extract nick from bufferline prefix var nick = prefix[prefix.length - 1].text; diff --git a/js/models.js b/js/models.js index f465ee2..ed3e6f1 100644 --- a/js/models.js +++ b/js/models.js @@ -359,6 +359,11 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo var highlight = message.highlight; var content = parseRichText(message.message); + // only put invisible angle brackets around nicks in normal messages + // (for copying/pasting) + var showHiddenBrackets = (tags_array.indexOf('irc_privmsg') >= 0 && + tags_array.indexOf('irc_action') === -1); + if (highlight) { prefix.forEach(function(textEl) { textEl.classes.push('highlight'); @@ -386,8 +391,8 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo highlight: highlight, displayed: displayed, prefixtext: prefixtext, - text: rtext - + text: rtext, + showHiddenBrackets: showHiddenBrackets }; };