Merge pull request #1145 from AStove/FixColorsInBuffers

Downgrade rich text for buffers
This commit is contained in:
Lorenz Hübschle-Schneider 2020-07-20 10:12:51 +02:00 committed by GitHub
commit 3f393a62ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -18,6 +18,10 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo
this.outgoingQueries = []; this.outgoingQueries = [];
var parseRichText = function(text) { var parseRichText = function(text) {
if(!text) {
return [{text}];
}
var textElements = weeChat.Protocol.rawText2Rich(text), var textElements = weeChat.Protocol.rawText2Rich(text),
typeToClassPrefixFg = { typeToClassPrefixFg = {
'option': 'cof-', 'option': 'cof-',
@ -64,8 +68,8 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo
*/ */
this.Buffer = function(message) { this.Buffer = function(message) {
// weechat properties // weechat properties
var fullName = message.full_name; var fullName = parseRichText(message.full_name)[0].text;
var shortName = message.short_name; var shortName = parseRichText(message.short_name)[0].text;
var hidden = message.hidden; var hidden = message.hidden;
// If it's a channel, trim away the prefix (#, &, or +). If that is empty and the buffer // If it's a channel, trim away the prefix (#, &, or +). If that is empty and the buffer
// has a short name, use a space (because the prefix will be displayed separately, and we don't want // has a short name, use a space (because the prefix will be displayed separately, and we don't want