aboutsummaryrefslogtreecommitdiff
path: root/webclient/client.html
diff options
context:
space:
mode:
Diffstat (limited to 'webclient/client.html')
-rw-r--r--webclient/client.html8
1 files changed, 5 insertions, 3 deletions
diff --git a/webclient/client.html b/webclient/client.html
index fce719d..ab10cbc 100644
--- a/webclient/client.html
+++ b/webclient/client.html
@@ -112,7 +112,8 @@ function reconnect(){
if(id=="_push"){
if(type=="message"){
var r=spl.word[2],u=spl.word[3],t=new Date(+spl.word[4]/1000);
- addRoomEntry(r,"message",[u,t,spl.rest[5]]);
+ // Ignore msgid at word[5]
+ addRoomEntry(r,"message",[u,t,spl.rest[6]]);
} else if(type=="invite"){
var r=spl.word[2];
roomlist.push(r);
@@ -135,6 +136,7 @@ function reconnect(){
var obj;
if(type=="ok")fn(true);
else if(type=="error")fn(null,spl.rest[2]);
+ else if(type=="number")fn(+spl.rest[2]);
else if(type=="name")fn(spl.rest[2]);
else if(type=="list")fn(spl.word.slice(3));
else if(type=="history"){
@@ -421,8 +423,8 @@ function sendMessage(roomid,text){
return;
}
var sentAs=username,msg=text.replace(/\n/g,"");
- net_send("send "+roomid+" "+msg,function(ok,err){
- if(ok){
+ net_send("send "+roomid+" "+msg,function(msgid,err){
+ if(msgid!=null){
addRoomEntry(roomid,"message",[sentAs,new Date().getTime(),msg]);
return;
}