X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=modules%2Ferl%2Feuphorik_protocole.erl;h=58a8df935f1fdfef4c9a037426d579d0bacf5c18;hb=4c8bece326d3f8f7d65faf7f80a19cf796fb46d1;hp=8056f6be6f3b9d3cf2d8fff69ee6bcc26bb06b84;hpb=327c3bd99f586f3cf3af55f9adb10a71eb78cdd4;p=euphorik.git diff --git a/modules/erl/euphorik_protocole.erl b/modules/erl/euphorik_protocole.erl index 8056f6b..58a8df9 100755 --- a/modules/erl/euphorik_protocole.erl +++ b/modules/erl/euphorik_protocole.erl @@ -1,7 +1,25 @@ -% coding: utf-8 +% coding: utf-8 +% Copyright 2008 Grégory Burri +% +% This file is part of Euphorik. +% +% Euphorik is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% Euphorik is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with Euphorik. If not, see . +% % Ce module gére les différents messages envoyés par le client (javascript) via AJAX. % Les messages donnés ainsi que les réponses sont au format JSON. % @author G.Burri + -module(euphorik_protocole). -export([ @@ -20,7 +38,6 @@ list_banned_ips/1, erreur/1 ]). --include_lib("xmerl/include/xmerl.hrl"). -include("../include/euphorik_bd.hrl"). -include("../include/euphorik_defines.hrl"). @@ -68,8 +85,8 @@ loginUser({ok, User}, IP) -> json_reponse_login_ok(User); loginUser(_, _) -> % ajoute un délais d'attente - timer:sleep(1000), - erreur("Erreur login"). + timer:sleep(?TEMPS_ATTENTE_ERREUR_LOGIN), + erreur("Couple login/pass introuvable"). % Renvoie un string() représentant un cookie en base 36. Il y a 10^32 possibillités. @@ -211,6 +228,7 @@ wait_event_page_chat(User, Racines_conversations, Message_count, Last_message_id {struct, [ {reply, "new_troll"}, {troll_id, Current#troll.id}, + {message_id, euphorik_bd:message_id_associe(Current#troll.id)}, {content, Current#troll.content} ]}; _ ->