Home | History | Annotate | Download | only in muc

Lines Matching defs:presence

56 import org.jivesoftware.smack.packet.Presence;
91 private Map<String, Presence> occupantsMap = new ConcurrentHashMap<String, Presence>();
333 // We create a room by sending a presence packet to room@service/nick
335 Presence joinPresence = new Presence(Presence.Type.available);
339 // Invoke presence interceptors so that extra information can be dynamically added
344 // Wait for a presence packet back from the server.
348 new PacketTypeFilter(Presence.class));
353 Presence presence =
354 (Presence) response.nextResult(SmackConfiguration.getPacketReplyTimeout());
358 if (presence == null) {
361 else if (presence.getError() != null) {
362 throw new XMPPException(presence.getError());
370 MUCUser mucUser = getMUCUserExtension(presence);
463 // We join a room by sending a presence packet where the "to"
465 Presence joinPresence = new Presence(Presence.Type.available);
477 // Invoke presence interceptors so that extra information can be dynamically added
482 // Wait for a presence packet back from the server.
486 new PacketTypeFilter(Presence.class));
488 Presence presence;
494 presence = (Presence) response.nextResult(timeout);
503 if (presence == null) {
506 else if (presence.getError() != null) {
507 throw new XMPPException(presence.getError());
532 // We leave a room by sending a presence packet where the "to"
534 Presence leavePresence = new Presence(Presence.Type.unavailable);
536 // Invoke presence interceptors so that extra information can be dynamically added
704 // Wait for a presence packet back from the server.
898 * Adds a new {@link PacketInterceptor} that will be invoked every time a new presence
900 * add new extensions to the presence that is going to be sent to the MUC service.
902 * @param presenceInterceptor the new packet interceptor that will intercept presence packets.
909 * Removes a {@link PacketInterceptor} that was being invoked every time a new presence
911 * add new extensions to the presence that is going to be sent to the MUC service.
977 * will receive two presence packets. One of type "unavailable" for the old nickname and one
978 * indicating availability for the new nickname. The unavailable presence will contain the new
979 * nickname and an appropriate status code (namely 303) as extended presence information. The
994 // We change the nickname by sending a presence packet where the "to"
997 Presence joinPresence = new Presence(Presence.Type.available);
999 // Invoke presence interceptors so that extra information can be dynamically added
1004 // Wait for a presence packet back from the server.
1008 new PacketTypeFilter(Presence.class));
1013 Presence presence =
1014 (Presence) response.nextResult(SmackConfiguration.getPacketReplyTimeout());
1018 if (presence == null) {
1021 else if (presence.getError() != null) {
1022 throw new XMPPException(presence.getError());
1028 * Changes the occupant's availability status within the room. The presence type
1029 * will remain available but with a new status that describes the presence update and
1030 * a new presence mode (e.g. Extended away).
1032 * @param status a text message describing the presence update.
1033 * @param mode the mode type for the presence update.
1035 public void changeAvailabilityStatus(String status, Presence.Mode mode) {
1045 // We change the availability status by sending a presence packet to the room with the
1046 // new presence status and mode
1047 Presence joinPresence = new Presence(Presence.Type.available);
1051 // Invoke presence interceptors so that extra information can be dynamically added
1061 * Kicks a visitor or participant from the room. The kicked occupant will receive a presence
1064 * was kicked from the room, the rest of the occupants will receive a presence of type
1065 * "unavailable". The presence will include a status code 307 which means that the occupant
1563 * the server to send all presence packets to this client.
1588 * Returns the presence info for a particular user, or <tt>null</tt> if the user
1591 * @param user the room occupant to search for his presence. The format of user must
1593 * @return the occupant's current presence, or <tt>null</tt> if the user is unavailable
1594 * or if no presence information is available.
1596 public Presence getOccupantPresence(String user) {
1605 * @param user the room occupant to search for his presence. The format of user must
1610 Presence presence = occupantsMap.get(user);
1611 if (presence != null) {
1612 return new Occupant(presence);
1618 * Adds a packet listener that will be notified of any new Presence packets
1622 * @param listener a packet listener that will be notified of any presence packets
1631 * Remoces a packet listener that was being notified of any new Presence packets
1634 * @param listener a packet listener that was being notified of any presence packets
2137 new AndFilter(new FromMatchesFilter(room), new PacketTypeFilter(Presence.class));
2156 // Create a listener for all presence updates.
2159 Presence presence = (Presence) packet;
2160 String from = presence.getFrom();
2162 boolean isUserStatusModification = presence.getFrom().equals(myRoomJID);
2163 if (presence.getType() == Presence.Type.available) {
2164 Presence oldPresence = occupantsMap.put(from, presence);
2171 mucExtension = getMUCUserExtension(presence);
2192 else if (presence.getType() == Presence.Type.unavailable) {
2194 MUCUser mucUser = getMUCUserExtension(presence);
2196 // Fire events according to the received presence code
2199 presence.getFrom().equals(myRoomJID),
2270 * @param oldRole the previous role of the user in the room before receiving the new presence
2271 * @param newRole the new role of the user in the room after receiving the new presence
2272 * @param isUserModification whether the received presence is about your user in the room or not
2383 * new presence
2385 * presence
2386 * @param isUserModification whether the received presence is about your user in the room or not
2468 * Fires events according to the received presence code.