Commit 87aca610df7ef1eeb8fa345363de8d156c8026d1

Authored by Rodrigo Souto
1 parent 9c5b8242

chat: update notice instead of appending a new one everytime

Showing 1 changed file with 6 additions and 1 deletions   Show diff stats
public/javascripts/chat.js
... ... @@ -488,7 +488,11 @@ jQuery(function($) {
488 488  
489 489 show_notice: function(jid_id, msg) {
490 490 var tab_id = '#' + Jabber.conversation_prefix + jid_id;
491   - $(tab_id).find('.history').append("<span class='notice'>" + msg + "</span>");
  491 + var notice = $(tab_id).find('.history .notice');
  492 + if (notice.length > 0)
  493 + notice.html(msg)
  494 + else
  495 + $(tab_id).find('.history').append("<span class='notice'>" + msg + "</span>");
492 496 }
493 497 };
494 498  
... ... @@ -515,6 +519,7 @@ jQuery(function($) {
515 519 $('#chat').bind('opengroup', function(ev, anchor) {
516 520 var full_jid = anchor.replace('#', '');
517 521 var jid = Strophe.getBareJidFromJid(full_jid);
  522 + console.log('>>>> '+jid);
518 523 var name = Strophe.getResourceFromJid(full_jid);
519 524 var jid_id = Jabber.jid_to_id(full_jid);
520 525 if (full_jid) {
... ...