From c334bea0a39a2627e63102fb95b62517dc4c0b69 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 8 Apr 2017 12:10:26 +0200 Subject: webclient: Support _push invite/join --- webclient/client.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'webclient/client.html') diff --git a/webclient/client.html b/webclient/client.html index f905569..53a06bf 100644 --- a/webclient/client.html +++ b/webclient/client.html @@ -97,6 +97,15 @@ function reconnect(){ 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]]); + } else if(type=="invite"){ + var r=spl.word[2]; + roomlist.push(r); + roomlogs.set(r,[]); + fetchRoomHistory(r); + updateRoomList(); + } else if(type=="join"){ + var r=spl.word[2],u=spl.word[3]; + addRoomEntry(r,"notice",["User '"+u+"' joined this room"]); } else { alert("Unknown push message type '"+type+"'!"); } @@ -339,7 +348,7 @@ function executeCommand(roomid,text){ othername=spl.rest[1]; net_send("invite "+currentroom+" "+othername,function(ok,err){ if(err){ - addRoomEntry(roomid,"error",["Unable to invite '"+othername+": "+err]); + addRoomEntry(roomid,"error",["Unable to invite '"+othername+"': "+err]); } else { addRoomEntry(roomid,"notice",["Successfully invited '"+othername+"'"]); } -- cgit v1.2.3-70-g09d2