Revert "Show nick if time difference between messages is 1min+"
authorVlad Chernushevich <mailbox@happytodesign.com>
Thu, 20 Jun 2013 22:30:48 +0000 (00:30 +0200)
committerVlad Chernushevich <mailbox@happytodesign.com>
Thu, 20 Jun 2013 22:30:48 +0000 (00:30 +0200)
This reverts commit 3c4887776ecacb4cf6cb6e1fd61223aecbdc3ea0.

client/assets/src/models/panel.js
client/assets/src/views/panel.js

index fe413084b667f2f2991a1602f513faa5268c8c41..2efbe5aaeeadbce762cd7cc5844890d5afec1fd3 100644 (file)
@@ -16,7 +16,7 @@ _kiwi.model.Panel = Backbone.Model.extend({
 \r
         // Time defaults to now\r
         if (!opts || typeof opts.time === 'undefined') {\r
-            d = opts.date = new Date();\r
+            d = new Date();\r
             opts.time = d.getHours().toString().lpad(2, "0") + ":" + d.getMinutes().toString().lpad(2, "0") + ":" + d.getSeconds().toString().lpad(2, "0");\r
         }\r
 \r
@@ -26,7 +26,7 @@ _kiwi.model.Panel = Backbone.Model.extend({
         }\r
 \r
         // Run through the plugins\r
-        message_obj = {"msg": msg, "date": opts.date, "time": opts.time, "nick": nick, "chan": this.get("name"), "type": type, "style": opts.style};\r
+        message_obj = {"msg": msg, "time": opts.time, "nick": nick, "chan": this.get("name"), "type": type, "style": opts.style};\r
         //tmp = _kiwi.plugs.run('addmsg', message_obj);\r
         if (!message_obj) {\r
             return;\r
index af8d1712bb194c68ab7ace8f75aa551b232a2dda..5d0644f4669bcf80e4429e5aa85784a052660c20 100644 (file)
@@ -44,9 +44,8 @@ _kiwi.view.Panel = Backbone.View.extend({
     },
 
     newMsg: function (msg) {
-        var re, line_msg, $this = this.$el,
+        var template_vars, re, line_msg, $this = this.$el,
             nick_colour_hex, nick_hex, is_highlight, msg_css_classes = '',
-            template_vars, time_difference,
             sb = this.model.get('scrollback'),
             prev_msg = sb[sb.length-2];
 
@@ -116,12 +115,8 @@ _kiwi.view.Panel = Backbone.View.extend({
         }
 
         template_vars = _.clone(msg);
-
-        if (prev_msg) {
-            time_difference = (template_vars.date.getTime() - prev_msg.date.getTime())/1000/60;
-            if (prev_msg.nick === template_vars.nick && time_difference < 1) {
-                template_vars.nick = '';
-            }
+        if (prev_msg && prev_msg.nick === template_vars.nick) {
+            template_vars.nick = '';
         }
 
         // Build up and add the line