Commit 607decd29775f87bbc6576671571f0bff5227a07

Authored by Rodrigo Souto
1 parent 032a2ee6

Add default value for offset

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
public/javascripts/chat.js
... ... @@ -117,6 +117,7 @@ jQuery(function($) {
117 117 },
118 118  
119 119 show_message: function (jid, name, body, who, identifier, time, offset) {
  120 + if(!offset) offset = 0;
120 121 if (body) {
121 122 body = Jabber.render_body_message(body);
122 123 var jid_id = Jabber.jid_to_id(jid);
... ... @@ -124,7 +125,7 @@ jQuery(function($) {
124 125 var history = $(tab_id).find('.history');
125 126  
126 127 var offset_container = $('#chat-offset-container-'+offset);
127   - if(offset_container.length == 0)
  128 + if(offset_container.length == 0)
128 129 offset_container = $('<div id="chat-offset-container-'+offset+'"></div>').prependTo(history);
129 130  
130 131 if (offset_container.find('.message:last').attr('data-who') == who) {
... ...