X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2FpageMinichat%2Fconversations.js;h=277726db92e5ea0d0b6f988631460a68206979ad;hp=d5a40e620a3e9c8a5a2ac05231c7d664245dd21b;hb=4f15129b495827b1894f8a234cc8f32262233fb1;hpb=7e471788d9356b1cb8659513674df9a883101807 diff --git a/js/pageMinichat/conversations.js b/js/pageMinichat/conversations.js index d5a40e6..277726d 100644 --- a/js/pageMinichat/conversations.js +++ b/js/pageMinichat/conversations.js @@ -57,12 +57,12 @@ euphorik.Conversations.prototype.toggleMessageRepond = function(mess) { }; /** - * Enlève tous les messages auquel l'utilisateur souhaite répond. + * Enlève tous les messages auquel l'utilisateur souhaite répondre. */ euphorik.Conversations.prototype.enleverMessagesRepond = function() { var thisConversations = this; - objectEach(function(messId, mess) { + objectEach(this.messagesRepond, function(messId, mess) { thisConversations.enleverMessageRepond(mess); }); @@ -93,12 +93,12 @@ euphorik.Conversations.prototype.ajouterMessageRepond = function(mess) { var mess2; for (mess2 in this.messagesRepond) { if (this.messagesRepond.hasOwnProperty(mess2)) { + mess2 = this.messagesRepond[mess2]; break; } } - mess2 = this.messagesRepond[mess2]; - if (!mess2 && mess2.racineId !== mess.racineId) { + if (mess2 && mess2.racineId !== mess.racineId) { this.util.messageDialogue("Impossible de répondre à deux messages ne faisant pas partie de la même conversation"); return; } @@ -156,7 +156,7 @@ euphorik.Conversations.prototype.rafraichireNombreMessagesRepond = function() { */ euphorik.Conversations.prototype.afficherMessagesRepondConversations = function() { var expr = ""; - objectEach(function(messId, mess) { + objectEach(this.messagesRepond, function(messId, mess) { expr += "#" + mess.getId() + ","; }); $(expr).addClass("repondEnEvidence"); @@ -182,13 +182,14 @@ euphorik.Conversations.prototype.getJSONrafraichirMessages = function() { }; euphorik.Conversations.prototype.getJSONConversations = function() { + var thisConversations = this var clientConv = []; this.client.conversations.each(function(i, conv) { clientConv.push({ root : conv.root, page : conv.page, - last_message_id : this.conversations[i + 1] ? this.conversations[i + 1].idDernierMessageAffiche : 0 + last_message_id : thisConversations.conversations[i + 1] ? thisConversations.conversations[i + 1].idDernierMessageAffiche : 0 }); }); return clientConv;