Presence.setTo
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.jivesoftware.smack.packet.Presence.setTo(Showing top 15 results out of 315)

origin: org.igniterealtime.smack/smack-core

/**
 * Creates a new presence with the given type and using the given XMPP address as recipient.
 *
 * @param to the recipient.
 * @param type the type.
 * @since 4.2
 */
public Presence(Jid to, Type type) {
  this(type);
  setTo(to);
}
origin: org.igniterealtime.smack/smack-extensions

Presence getJoinPresence(MultiUserChat multiUserChat) {
  final EntityFullJid jid = JidCreate.fullFrom(multiUserChat.getRoom(), nickname);
  joinPresence.setTo(jid);
  return joinPresence;
}
origin: stackoverflow.com

 Presence response = new Presence.Type.subscribed);
response.setTo(address);
sendPacket(response);

Roster roster = mConnection.getRoster();
roster.createEntry(address, name, groups);
origin: TheHolyWaffle/League-of-Legends-XMPP-Chat-Library

private void decline(String from) throws NotConnectedException {
  final Presence newp = new Presence(Presence.Type.unsubscribed);
  newp.setTo(from);
  connection.sendPacket(newp);
}
origin: igniterealtime/Spark

/**
 * Handles the ?unsubscribe URI
 * 
 * @param uri
 *            the decoded uri
 */
public void handleUnsubscribe(URI uri) throws SmackException.NotConnectedException
{
String jid = retrieveJID(uri);
Presence response = new Presence(Presence.Type.unsubscribe);
response.setTo(jid);
SparkManager.getConnection().sendStanza(response);
}
origin: igniterealtime/Spark

/**
 * Send my presence for user
 * 
 * @param jid
 *            JID to send presence
 */
public void sendRealPresenceTo(String jid) throws SmackException.NotConnectedException
{
  Presence presence = SparkManager.getWorkspace().getStatusBar().getPresence(); 
  Presence pack = new Presence(presence.getType(), presence.getStatus(), 1, presence.getMode()); 
  pack.setTo(jid);
  SparkManager.getConnection().sendStanza(pack);
}
origin: stackoverflow.com

 Presence presence = new Presence(Presence.Type.available);
presence.setTo(roomJID);

//Setting MaxStanzas to 0
MUCInitialPresence m = new MUCInitialPresence();
History h = new History();
h.setMaxStanzas(0);
m.setHistory(h);
presence.addExtension(m);

try {
  connection.sendStanza(presence);
} catch (NotConnectedException e) {
}
origin: igniterealtime/Spark

/**
 * Send Unavailable (offline status) to jid .
 * 
 * @param jid
 *            JID to send offline status
 */
public void sendUnavailableTo(String jid) throws SmackException.NotConnectedException
{
  Presence pack = new Presence(Presence.Type.unavailable);                                                  
  pack.setTo(jid);
  SparkManager.getConnection().sendStanza(pack);
}
origin: stackoverflow.com

 Presence presence = (Presence) packet;
Presence presence_request = new Presence(Presence.Type.subscribed);
presence_request.setTo(presence.getFrom());
presence_request.setType(Presence.Type.subscribed);
presence_request.setFrom("current_logged_in_user");
connection.sendPacket(presence_request);
roster.createEntry(presence.getFrom(), null, null);
origin: org.igniterealtime.smack/smack-im

public void sendSubscriptionRequest(BareJid jid) throws NotLoggedInException, NotConnectedException, InterruptedException {
  final XMPPConnection connection = getAuthenticatedConnectionOrThrow();
  // Create a presence subscription packet and send.
  Presence presencePacket = new Presence(Presence.Type.subscribe);
  presencePacket.setTo(jid);
  connection.sendStanza(presencePacket);
}
origin: TheHolyWaffle/League-of-Legends-XMPP-Chat-Library

private void accept(String from) throws NotConnectedException {
  final Presence newp = new Presence(Presence.Type.subscribed);
  newp.setTo(from);
  connection.sendPacket(newp);
  final Presence subscription = new Presence(Presence.Type.subscribe);
  subscription.setTo(from);
  connection.sendPacket(subscription);
  if (api.isOnline()) {
    api.setOnline();
  }
}
origin: stackoverflow.com

if(selectedRoster != null) {
   Presence presence = new Presence(Presence.Type.unsubscribe);
   presence.setTo(selectedRoster.getUser());
   presence.setStatus("Offline");
   presence.setShow("unavailable");
   ConnectionController.GetInstance(this).getXMPPConnection().sendPacket(presence);
   try {
     roster.removeEntry(selectedRoster);
   } catch (XMPPException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
 }
origin: stackoverflow.com

 //subscribe to eachother
connection.login("tester", ...); 
Presence subscribe = new Presence(Presence.Type.subscribe);
subscribe.setTo("sanika@sanika.com");
connection.sendPacket(subscribe);
connection.disconnect();
...                
connection.connect();
connection.login("sanika", ...); 
subscribe = new Presence(Presence.Type.subscribe);
subscribe.setTo("tester@localhost");
connection.sendPacket(subscribe);
connection.disconnect();
origin: stackoverflow.com

Presence subscription = new Presence(
       Presence.Type.subscribe);
   subscription.setTo(CurrentUser+"@reza-hp");
   subscription.setPriority(24);
   newp.setMode(Presence.Mode.available);
   connection.sendPacket(subscription);
origin: org.igniterealtime.smack/smack-extensions

Presence getJoinPresence(MultiUserChat multiUserChat) {
  final EntityFullJid jid = JidCreate.fullFrom(multiUserChat.getRoom(), nickname);
  joinPresence.setTo(jid);
  return joinPresence;
}
org.jivesoftware.smack.packetPresencesetTo

Popular methods of Presence

  • <init>
    Creates a new presence with the given type and using the given XMPP address as recipient.
  • getFrom
  • getType
    Returns the type of this presence packet.
  • isAvailable
    Returns true if the Type is available (online) and false if the user is unavailable (offline), or if
  • getMode
    Returns the mode of the presence update.
  • setStatus
    Sets the status message of the presence update. The status is free-form text describing a user's pre
  • addExtension
  • getPriority
    Returns the priority of the presence, or Integer.MIN_VALUE if no priority has been set.
  • setMode
    Sets the mode of the presence update. A null presence mode value is interpreted to be the same thing
  • getStatus
    Returns the status message of the presence update, or null if there is not a status. The status is f
  • setFrom
  • getError
  • setFrom,
  • getError,
  • getExtension,
  • setPriority,
  • setType,
  • getTo,
  • toXML,
  • clone,
  • getExtensionsXML

Popular classes and methods

  • compareTo (BigDecimal)
    Compares this BigDecimal with val. Returns one of the three values 1, 0, or -1. The method behaves a
  • getExternalFilesDir (Context)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)