From: Greg Burri Date: Tue, 22 Apr 2008 06:50:20 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 1.0.0^2~145 X-Git-Url: http://git.euphorik.ch/index.cgi?a=commitdiff_plain;h=b5878679d51e91e8a86dd042251c91290bf8caf2;p=euphorik.git --- diff --git a/doc/protocole3.txt b/doc/protocole3.txt index c3c2e6a..fdb68df 100644 --- a/doc/protocole3.txt +++ b/doc/protocole3.txt @@ -148,21 +148,24 @@ Le format de la date n'est pas formel. { "reply" : "new_messages", "conversations" : [ - "last_page" : true | false, - "messages" : [ - "id" : 54, - "date" : "Hier 17:26:54", - "system" : true | false, - "owner" : true | false, - "answered" : true | false, - "is_a_reply" : true | false, - "nick" : "Paul", - "login" : "paul_22", - "content" : "Salut", - "answer_to" : [ - { "id" : 123, "pseudo" : "Pierre", "login" : "pierre_45" } + { + "last_page" : true | false, + "messages" : [ + "id" : 54, + "date" : "Hier 17:26:54", + "system" : true | false, + "owner" : true | false, + "answered" : true | false, + "is_a_reply" : true | false, + "nick" : "Paul", + "login" : "paul_22", + "content" : "Salut", + "answer_to" : [ + { "id" : 123, "pseudo" : "Pierre", "login" : "pierre_45" } + ] ] - ] + } + ... ] } ou diff --git a/modules/erl/euphorik_protocole.erl b/modules/erl/euphorik_protocole.erl index 40af2ea..4eed84d 100755 --- a/modules/erl/euphorik_protocole.erl +++ b/modules/erl/euphorik_protocole.erl @@ -115,29 +115,17 @@ wait_event( end, {Main_page, _} = lists:keysearch(main_page, 1, Reste), {{array, Conversations_json}, _} = lists:keysearch(conversations, 1, Reste), - User = euphorik_minichat:user_by_cookie(Cookie), - - - % TODO.... - - - - simple_xml_to_string( - case xmerl_xpath:string("nombreMessage", Action) of % le nombre de message qu'affiche le client - [#xmlElement{content = [#xmlText{value = Nb_message_str}]}] -> - Nb_message = list_to_integer(Nb_message_str), - Dernier_id = case xmerl_xpath:string("dernierMessageId", Action) of % l'id du dernier message que connait le client - [#xmlElement{content = [#xmlText{value = D}]}] -> erlang:list_to_integer(D, 36); - _ -> 0 - end, - User = case xmerl_xpath:string("cookie", Action) of - [#xmlElement{content = [#xmlText{value = Cookie}]}] -> - case euphorik_minichat:user_by_cookie(Cookie) of - {ok, U} -> U; - _ -> inconnu - end; - _ -> inconnu - end, + User = case euphorik_minichat:user_by_cookie(Cookie) of + {ok U} -> U; + _ -> inconnu + end, + {stuct, [ + {reply, "new_message"}, + {conversations, {array, + TODO ... + } + ]} + % accrochez-vous ca va siouxer ;) [{reponse, [{name, "refreshMessages"}], lists:map( @@ -273,7 +261,7 @@ format_date(Date) -> %%%%%%%%% %%%%%%%%% json_reponse_ok() -> - {struct, [{status, "ok"}]}. + {struct, [{reply, "ok"}]}. % Construit une réponse positive à un login