You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only show contacts online, and when they disappear off
In basic file-chat.html
change the following lines:
-------------------------------------------------- Old ---------------------------------------------------------
onPresence: function(presence){
var contact = $("<li>");
contact.append("<a href='javascript:void(0)'>"+ presence.from +"</a>");
contact.find("a").click(function(){
var id = MD5.hexdigest(presence.from);
var conversation = $("#"+id);
if(conversation.length == 0)
openChat({to:presence.from});
});
contactList.append(contact);
},
-------------------------------------------------- Old ---------------------------------------------------------
replace this:
-------------------------------------------------- new ---------------------------------------------------------
//-----> Add contact on only, remove on offline.
var onlineoffline = presence.type;
if( onlineoffline == null ){
var contact = $("<li>");
contact.append("<a href='javascript:void(0)'>"+ presence.from +"</a>");
contact.find("a").click(function(){
var id = MD5.hexdigest(presence.from);
var conversation = $("#"+id);
if(conversation.length == 0)
openChat({to:presence.from});
});
contactList.append(contact);
}else{
var contactsx = $("#contacts").html();
var overcontactsx = contactsx.replace("<a href='javascript:void(0)'>"+ presence.from +"</a>","");
$("#contacts").html("teste");
}
//-----> Add contact on only, remove on offline.
-------------------------------------------------- new ---------------------------------------------------------
on script - jquery.xmpp.js
----------------------------------------------------- old ------------------------------------------------------
$.each(response.find("presence"),function(i,element){
try{
var e = $(element);
xmpp.onPresence({from: e.attr("from"), to: e.attr("to"), show: e.find("show").html()});
}catch(e){}
});
},
--------------------------------------------------------- old --------------------------------------------------
replace this:
--------------------------------------------------------------- new --------------------------------
$.each(response.find("presence"),function(i,element){
try{
var e = $(element);
xmpp.onPresence({from: e.attr("from"), type: e.attr("type") to: e.attr("to"), show: e.find("show").html()});
}catch(e){}
});
},
---------------------------------------- new ------------------------------------------
The text was updated successfully, but these errors were encountered:
Only show contacts online, and when they disappear off
In basic file-chat.html
change the following lines:
-------------------------------------------------- Old ---------------------------------------------------------
-------------------------------------------------- Old ---------------------------------------------------------
replace this:
-------------------------------------------------- new ---------------------------------------------------------
-------------------------------------------------- new ---------------------------------------------------------
on script - jquery.xmpp.js
----------------------------------------------------- old ------------------------------------------------------
--------------------------------------------------------- old --------------------------------------------------
replace this:
--------------------------------------------------------------- new --------------------------------
---------------------------------------- new ------------------------------------------
The text was updated successfully, but these errors were encountered: