- if (vider)
- thisMessages.viderMessages()
-
- // ajoute les messages reçus à leur conversation respective
- for (var numConv = 0; numConv < data["conversations"].length; numConv++)
- {
- if (! thisMessages.ajouterMessages(data["conversations"][numConv], numConv))
+ this.pageEvent.waitEvent(
+ function() { return thisMessages.getJSONrafraichirMessages() },
+ function(data)
+ {
+ if (vider)
+ {
+ thisMessages.viderMessages()
+ vider = false
+ }
+
+ // en fonction du message
+ switch(data["reply"])
+ {
+ case "new_troll" :
+ thisMessages.trollIdCourant = data["troll_id"]
+ $("#trollCourant .troll").html(thisMessages.formateur.traitementComplet(data["content"]))
+ $("#trollCourant .troll a[@rel*=lightbox]").lightBox()
+ break
+
+ case "new_messages" :
+ // ajoute les messages reçus à leur conversation respective
+ for (var numConv = 0; numConv < data["conversations"].length; numConv++)