FIX plein de bugs introduits avec la Grand Restructuration
[euphorik.git] / js / pageMinichat / conversations.js
index 2d5df0c..277726d 100644 (file)
@@ -93,12 +93,12 @@ euphorik.Conversations.prototype.ajouterMessageRepond = function(mess) {
    var mess2;\r
    for (mess2 in this.messagesRepond) {\r
       if (this.messagesRepond.hasOwnProperty(mess2)) {\r
+         mess2 = this.messagesRepond[mess2];\r
          break;\r
       }\r
    }\r
-   mess2 = this.messagesRepond[mess2];\r
    \r
-   if (mess2 && mess2.racineId == mess.racineId) {\r
+   if (mess2 && mess2.racineId !== mess.racineId) {\r
       this.util.messageDialogue("Impossible de répondre à deux messages ne faisant pas partie de la même conversation");\r
       return;\r
    }\r
@@ -182,13 +182,14 @@ euphorik.Conversations.prototype.getJSONrafraichirMessages = function() {
 };\r
 \r
 euphorik.Conversations.prototype.getJSONConversations = function() {\r
+   var thisConversations = this\r
    var clientConv = [];\r
    \r
    this.client.conversations.each(function(i, conv) {\r
       clientConv.push({\r
          root : conv.root,\r
          page : conv.page,\r
-         last_message_id : this.conversations[i + 1] ? this.conversations[i + 1].idDernierMessageAffiche : 0\r
+         last_message_id : thisConversations.conversations[i + 1] ? thisConversations.conversations[i + 1].idDernierMessageAffiche : 0\r
       });\r
    });\r
    return clientConv;\r