aboutsummaryrefslogtreecommitdiff
path: root/webclient/client.html
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-04-07 23:58:01 +0200
committertomsmeding <tom.smeding@gmail.com>2017-04-07 23:58:01 +0200
commit4dcb97eec19bcb5365fb355a81e299545b97ef75 (patch)
tree4f21b885d8e600de56d4b284265a8eb891d616e3 /webclient/client.html
parent93a75abb1daaf2d4dfa59c348d6a08d8ca0c9659 (diff)
Make protocol more consistent
Diffstat (limited to 'webclient/client.html')
-rw-r--r--webclient/client.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/webclient/client.html b/webclient/client.html
index 241ca90..f905569 100644
--- a/webclient/client.html
+++ b/webclient/client.html
@@ -95,8 +95,8 @@ function reconnect(){
var id=spl.word[0],type=spl.word[1];
if(id=="_push"){
if(type=="message"){
- var r=spl.word[2],u=spl.word[3];
- addRoomEntry(r,"message",[u,new Date().getTime(),spl.rest[4]]);
+ var r=spl.word[2],u=spl.word[3],t=new Date(+spl.word[4]/1000);
+ addRoomEntry(r,"message",[u,t,spl.rest[5]]);
} else {
alert("Unknown push message type '"+type+"'!");
}
@@ -111,7 +111,7 @@ function reconnect(){
else if(type=="history"){
var count=+spl.word[2];
net_callbacks[id]=net_historyCollectionCallback.bind(this,id,[],count,fn);
- } else if(type=="history_item")fn([spl.word[3],+spl.word[4]/1000,spl.rest[5]]);
+ } else if(type=="history_message")fn([spl.word[4],+spl.word[5]/1000,spl.rest[6]]);
else alert("Unknown server response message type '"+type+"'!");
} else {
alert("No callback for server message id '"+id+"'!");