From 2f1e7834a3be8b97b319d45f0ae51a5e66cf4e43 Mon Sep 17 00:00:00 2001
From: Tor Hveem <tor@hveem.no>
Date: Sat, 12 Oct 2013 11:54:19 +0200
Subject: [PATCH] Fix color parsing in prefix

---
 js/models.js | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/js/models.js b/js/models.js
index 718fa00..8f3b2a1 100644
--- a/js/models.js
+++ b/js/models.js
@@ -47,24 +47,13 @@ models.service('models', ['colors', function(colors) {
      */
     this.BufferLine = function(message) {
 
-        function formatTextElement(textElement) {
-
-            textElement = colors.parse(textElement);
-
-            if (textElement && ('fg' in textElement)) {
-                textElement['fg'] = colors.prepareCss(textElement['fg']);
-            }
-
-            return textElement;
-        }
-
         /*
          * Parse the text elements from the buffer line added
          *
          * @param message weechat message
          */
         function parseLineAddedTextElements(message) {
-            var text = colors.parse(message['message']);
+            var text = colors.parse(message);
             text_elements =_.map(text, function(text_element) {
                 if (text_element && ('fg' in text_element)) {
                     text_element['fg'] = colors.prepareCss(text_element['fg']);
@@ -81,14 +70,12 @@ models.service('models', ['colors', function(colors) {
         var date = message['date'];
 
 
-        var prefix = formatTextElement(message['prefix']);
-        console.log(message['prefix'])
-        console.log(prefix);
+        var prefix = parseLineAddedTextElements(message['prefix']);
 
         var tags_array = message['tags_array'];
         var displayed = message['displayed'];
         var highlight = message['highlight'];
-        var content = parseLineAddedTextElements(message);
+        var content = parseLineAddedTextElements(message['message']);
 
         var rtext = "";
         if(content[0] != undefined) {