X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2Fclient.js;h=9daa0f54f59b4f995b7630d6bef1004e2844ad28;hp=d7240a6d197b9e1af1d6d048c708efa6fad38e98;hb=d1e6f8e7c86f1ee75e854266463541ffedb916c9;hpb=e6475e1885c0a0f102387c01e9bcb78ac09b4ef8 diff --git a/js/client.js b/js/client.js index d7240a6..9daa0f5 100644 --- a/js/client.js +++ b/js/client.js @@ -180,13 +180,17 @@ euphorik.Client.prototype.getJSONLoginCookie = function() { * de s'autentifier avec (login, password). */ euphorik.Client.prototype.getJSONEnregistrement = function(login, password) { - var mess = { "header" : { "action" : "register", "version" : euphorik.conf.versionProtocole } }; + var mess = { + "header" : { "action" : "register","version" : euphorik.conf.versionProtocole } + }; if (login && password) { mess.login = login; mess.password = password; } + mess.profile = this.getJSONProfileInfos(); + return mess; }; @@ -204,6 +208,12 @@ euphorik.Client.prototype.getJSONProfile = function() { "cookie" : this.cookie, "login" : this.login, "password" : this.password, + "profile" : this.getJSONProfileInfos() + }; +}; + +euphorik.Client.prototype.getJSONProfileInfos = function() { + return { "nick" : this.pseudo, "email" : this.email, "css" : this.css, @@ -302,7 +312,7 @@ euphorik.Client.prototype.enregistrement = function(login, password) { }; /** - * Connexion. Réalisé de manière synchrone. + * Connexion. Réalisée de manière synchrone. */ euphorik.Client.prototype.connexion = function(messageJson) { var thisClient = this; @@ -346,20 +356,20 @@ euphorik.Client.prototype.chargerDonnees = function(data) { this.id = data.id; this.login = data.login; - this.pseudo = data.nick; - this.email = data.email; - this.setCss(data.css); - this.chatOrder = data.chat_order; - this.nickFormat = data.nick_format; - this.viewTimes = data.view_times; - this.viewTooltips = data.view_tooltips; - this.ostentatiousMaster = data.ostentatious_master; + this.pseudo = data.profile.nick; + this.email = data.profile.email; + this.setCss(data.profile.css); + this.chatOrder = data.profile.chat_order; + this.nickFormat = data.profile.nick_format; + this.viewTimes = data.profile.view_times; + this.viewTooltips = data.profile.view_tooltips; + this.ostentatiousMaster = data.profile.ostentatious_master; // la page de la conversation principale this.pagePrincipale = 1; // les conversations - this.conversations = data.conversations; + this.conversations = data.profile.conversations; this.conversations.map(function(conv) { return { root : conv.root, page : 1, reduit : conv.minimized }; });