[polari/wip/fmuellner/combined-gsoc: 21/137] experimental: substring index



commit b48123a07e4f39771349d2607ff4a8318e1cf33a
Author: Kunaal Jain <kunaalus gmail com>
Date:   Sun Jun 12 22:44:46 2016 +0530

    experimental: substring index

 src/mainWindow.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 5f9ba0c..03ad86f 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -266,7 +266,7 @@ const MainWindow = new Lang.Class({
         for (let i = 0; i < events.length; i++) {
             let message = events[i].mms;
             let uid = events[i].id;
-            let index = 0;
+            let index = message.indexOf(this._keywords[0] - 5);
             let row = this._widgetMap[uid];
             for (let j = 0; j < this._keywords.length; j++) {
                 // log(this._keywords[j]);
@@ -293,7 +293,7 @@ const MainWindow = new Lang.Class({
                 row.uid = events[i].id;
                 widgetMap[uid] = row;
             }
-            widgetMap[uid].get_children()[0].label = message;
+            widgetMap[uid].get_children()[0].label = message.substring(index - 2);
         }
 
         this._widgetMap = widgetMap;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]