Package org.jivesoftware.smackx.packet

Examples of org.jivesoftware.smackx.packet.MUCUser$Destroy


    public void disconnect() {
        if(nickList != null) nickList.clear();
    }

    public void doAction(String command, MUCBuddyStatus buddy) {
        MUCUser user = buddy.getMUCUser();
        if (user == null) {
            serverErrorMessage(resources.getString("jidNotFound"));
            return;
        }

        MUCUser.Item item = user.getItem();

        if (item == null) {
            serverErrorMessage(resources.getString("jidNotFound"));
            return;
        }
View Full Code Here


                MUCBuddyStatus buddy = window.getBuddyStatus(from);

                window.removeBuddy(buddy.getUser());

                // get the role and affiliation information
                MUCUser user = (MUCUser) presence.getExtension("x",
                        "http://jabber.org/protocol/muc#user");
                if (user != null) {
                    buddy.setMUCUser(user);
                    MUCUser.Item item = user.getItem();
                    if (item != null) {
                        if (item.getAffiliation() != null)
                            buddy.setAffiliation(item.getAffiliation());
                        if (item.getRole() != null)
                            buddy.setRole(item.getRole());
View Full Code Here

        public BanThread(String reason) {
            this.reason = reason;
        }

        public void run() {
            MUCUser user = ((MUCBuddyStatus) buddy).getMUCUser();
            if (user == null)
                return;

            MUCUser.Item item = user.getItem();
            if (item == null)
                return;

            String jid = item.getJid();
            if (jid == null)
View Full Code Here

  private void addUser(final String occupant) {
    userList.getDisplay().asyncExec(new Runnable() {

      public void run() {
        Presence presence = getPresence(occupant);
        MUCUser mucUser = (MUCUser) presence.getExtension("x",
            "http://jabber.org/protocol/muc#user");
        MUCUser.Item item = mucUser.getItem();
        final String nick = StringUtils.parseResource(presence.getFrom());
        String role = item.getRole();
        TreeItem occupantItem;
        //Do this here so the suubtrees are in the right order
        getModeratorsItem();
View Full Code Here

   *
   * @param occupant
   * @return
   */
  private MUCUser.Item getMUCItem(String occupant) {
    MUCUser mucUser = (MUCUser) getPresence(occupant)
      .getExtension("x", "http://jabber.org/protocol/muc#user");
    return mucUser.getItem();
  }
View Full Code Here

        this.nick = item.getNick();
    }

    Occupant(Presence presence) {
        super();
        MUCUser mucUser = (MUCUser) presence.getExtension("x",
                "http://jabber.org/protocol/muc#user");
        MUCUser.Item item = mucUser.getItem();
        this.jid = item.getJid();
        this.affiliation = item.getAffiliation();
        this.role = item.getRole();
        // Get the nickname from the FROM attribute of the presence
        this.nick = StringUtils.parseResource(presence.getFrom());
View Full Code Here

                }
            }

            else {
                // Check if a room invitation was sent and if the sender is the workgroup
                MUCUser mucUser = (MUCUser)msg.getExtension("x", "http://jabber.org/protocol/muc#user");
                MUCUser.Invite invite = mucUser != null ? mucUser.getInvite() : null;
                if (invite != null && workgroupJID.equals(invite.getFrom())) {
                    String sessionID = null;
                    Map metaData = null;

                    pe = msg.getExtension(SessionID.ELEMENT_NAME,
View Full Code Here

        }
        else if (packet instanceof Message) {
            Message message = (Message)packet;

            // Check if a room invitation was sent and if the sender is the workgroup
            MUCUser mucUser = (MUCUser)message.getExtension("x",
                    "http://jabber.org/protocol/muc#user");
            MUCUser.Invite invite = mucUser != null ? mucUser.getInvite() : null;
            if (invite != null && workgroupJID.equals(invite.getFrom())) {
                String sessionID = null;
                Map metaData = null;

                SessionID sessionIDExt = (SessionID)message.getExtension(SessionID.ELEMENT_NAME,
View Full Code Here

        this.nickname = nickname;
        joined = true;
        userHasJoined();

        // Look for confirmation of room creation from the server
        MUCUser mucUser = getMUCUserExtension(presence);
        if (mucUser != null && mucUser.getStatus() != null) {
            if ("201".equals(mucUser.getStatus().getCode())) {
                // Room was created and the user has joined the room
                return;
            }
        }
        // We need to leave the room since it seems that the room already existed
View Full Code Here

    public void invite(Message message, String user, String reason) {
        // TODO listen for 404 error code when inviter supplies a non-existent JID
        message.setTo(room);

        // Create the MUCUser packet that will include the invitation
        MUCUser mucUser = new MUCUser();
        MUCUser.Invite invite = new MUCUser.Invite();
        invite.setTo(user);
        invite.setReason(reason);
        mucUser.setInvite(invite);
        // Add the MUCUser packet that includes the invitation to the message
        message.addExtension(mucUser);

        connection.sendPacket(message);
    }
View Full Code Here

TOP

Related Classes of org.jivesoftware.smackx.packet.MUCUser$Destroy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.