Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

announance joining room

  • Loading branch information...
commit 67540bfa82226e30d5893a43d9f547c6cd240a9f 1 parent e664187
@mick authored
Showing with 16 additions and 4 deletions.
  1. +8 −4 web/static/client.js
  2. +8 −0 web/static/style.css
View
12 web/static/client.js
@@ -132,19 +132,23 @@ var talkback = {
var message = $msg.find("body").text();
var $messagebox = $("<div class='messagebox'><span class='username'>"+from+":</span> "+message+"</div>");
$("#chatcontent").append($messagebox);
- console.log(msg);
return true;
},
roomPresence:function(msg){
- console.log("presence: ",$(msg).attr("from"));
console.log("roster: ", talkback.roster);
- if($(msg).attr("from") in talkback.roster){
+ if(talkback.roster[$(msg).attr("from")] !== undefined){
if($(msg).find("photo").text() == talkback.roster[$(msg).attr("from")]){
// we have the image and it is current
return true;
}
+ }else{
+ //announce in chat.
+ var from = $(msg).attr("from").replace(talkback.roomjid+"/","");
+ var $messagebox = $("<div class='messagebox joined'>"+from+" joined</div>");
+ $("#chatcontent").append($messagebox);
+ talkback.roster[$(msg).attr("from")] = $(msg).attr("from");
}
- connection.vcard.get(talkback.vcardHandler, $(msg).attr("from"));
+ //connection.vcard.get(talkback.vcardHandler, $(msg).attr("from"));
return true;
},
sendRoomMessage:function(message){
View
8 web/static/style.css
@@ -70,6 +70,14 @@ div#chatcontent div.messagebox{
min-height:20px;
margin-bottom:10px;
}
+div#chatcontent div.messagebox.joined{
+ font-weight:bold;
+ font-size:0.6em;
+ color:#666;
+ min-height:10px;
+ padding:1px 5px;
+ margin-bottom:2px;
+}
div#chatcontent span.username{
font-weight:bold;
font-size:0.8em;
Please sign in to comment.
Something went wrong with that request. Please try again.