-% coding: utf-8
+% coding: utf-8\r
+% Copyright 2008 Grégory Burri\r
+%\r
+% This file is part of Euphorik.\r
+%\r
+% Euphorik is free software: you can redistribute it and/or modify\r
+% it under the terms of the GNU General Public License as published by\r
+% the Free Software Foundation, either version 3 of the License, or\r
+% (at your option) any later version.\r
+%\r
+% Euphorik is distributed in the hope that it will be useful,\r
+% but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+% GNU General Public License for more details.\r
+%\r
+% You should have received a copy of the GNU General Public License\r
+% along with Euphorik. If not, see <http://www.gnu.org/licenses/>.\r
+%
% 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
+\r
-module(euphorik_protocole).
-export([
list_banned_ips/1,
erreur/1
]).
--include_lib("xmerl/include/xmerl.hrl").
-include("../include/euphorik_bd.hrl").\r
-include("../include/euphorik_defines.hrl").\r
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").
\r
% Renvoie un string() représentant un cookie en base 36. Il y a 10^32 possibillités.\r
{struct, [
{reply, "new_troll"},
{troll_id, Current#troll.id},
+ {message_id, euphorik_bd:message_id_associe(Current#troll.id)},
{content, Current#troll.content}
]};
_ ->