X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=modules%2Ferl%2Feuphorik_protocole.erl;h=4eed84db9696d82ed069351c0160f8424a679ddf;hp=40af2ea95f4a7457c3afb0b2b58799946d2b6f4c;hb=b5878679d51e91e8a86dd042251c91290bf8caf2;hpb=ccb7fdfe9914f47cc38f96e5973851f2c6f0c4b6 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