use of org.jivesoftware.smack.RosterEntry in project Openfire by igniterealtime.
the class XMPPListener method entriesAdded.
public void entriesAdded(Collection<String> addresses) {
for (String addr : addresses) {
RosterEntry entry = getSession().conn.getRoster().getEntry(addr);
getSession().getBuddyManager().storeBuddy(new XMPPBuddy(getSession().getBuddyManager(), entry.getUser(), entry.getName(), entry.getGroups(), entry));
// Facebook does not support presence probes in their XMPP implementation. See http://developers.facebook.com/docs/chat#features
if (!TransportType.facebook.equals(getSession().getTransport().getType())) {
//ProbePacket probe = new ProbePacket(getSession().getJID()+"/"+getSession().xmppResource, entry.getUser());
ProbePacket probe = new ProbePacket(null, entry.getUser());
Log.debug("XMPP: Sending the following probe packet: " + probe.toXML());
try {
getSession().conn.sendPacket(probe);
} catch (IllegalStateException e) {
Log.debug("XMPP: Not connected while trying to send probe.");
}
}
}
}
use of org.jivesoftware.smack.RosterEntry in project intellij-plugins by JetBrains.
the class JabberSyncUserMessage method send.
public boolean send(User user) {
final JabberTransport jabberTransport = JabberTransport.getInstance();
if (jabberTransport != null && jabberTransport.isOnline()) {
final Roster roster = jabberTransport.getFacade().getConnection().getRoster();
final RosterEntry userEntry = roster.getEntry(myEvent.getUser().getName());
if (userEntry != null) {
jabberTransport.runIngnoringUserEvents(() -> processEvent(jabberTransport.getFacade(), userEntry));
}
return true;
}
return false;
}
Aggregations