Package nu.fw.jeti.plugins.groupchat.elements

Examples of nu.fw.jeti.plugins.groupchat.elements.XMUCUser


  }

  public Extension build()
  {
    if (invite) return new XMUCUserInvite(jid,reason,decline);
        return new XMUCUser(affiliation,role,nick,jid,statuscode,reason);
  }
View Full Code Here


            if(items==null) {
                items = new LinkedList();
            }
            try {
                JID jid = JID.checkedJIDFromString(attr.getValue("jid"));
                items.add(new XMUCUser(attr.getValue("affiliation"),
                                       attr.getValue("role"),
                                       null, jid, 0));
            } catch (InstantiationException e) {
                Log.xmlParseException(e);
            }
View Full Code Here

            }
            else chatSplitPane.appendSystemMessage(presence.getErrorDescription());
      return;
    }
    final JID jid = presence.getFrom();
    XMUCUser temp=null;
        if(presence.hasExtensions()) {
            for(Iterator i = presence.getExtensions();i.hasNext();) {
        Object o = i.next();
                if(o instanceof XMUCUser) {
          temp =(XMUCUser)o;
          break;
        }
      }
    }
    final XMUCUser xMucUser = temp;
        if (me.equals(jid.getResource())) {
            if(xMucUser!=null && xMucUser.getStatusCode()==303) {//own nickname change
        me = xMucUser.getNick();
                fullRoomJID = new JID(roomJID.getUser(),
                                      roomJID.getDomain(),me);
                btnStatus.setJID(fullRoomJID);
            } else {
                ownPresenceChanged(presence, xMucUser);
                if (xMucUser!=null && xMucUser.getStatusCode()==201) {
                    new IQMUCOwnerConfigure(backend, roomJID, new XData("submit"));
                }
            }
        }
        if(presence.getType().equals("unavailable")) {
View Full Code Here

                                          + user + "'", "Unknown user",
                                          JOptionPane.ERROR_MESSAGE);
            return;
        }

        tableModel.addUser(new XMUCUser(jid, XMUCUser.NONE, XMUCUser.NONE));
    }
View Full Code Here

            return;
        }
        int[] rows = tabMembers.getSelectedRows();
        Vector toChange = new Vector(rows.length);
        for (int i=0; i<rows.length; i++) {
            XMUCUser u = tableModel.getUserAt(sorter.modelIndex(rows[i]));
            if (u.getAffiliation() != affiliation) {
                toChange.add(u.getJID());
            }
        }
        new IQMUCSetList(backend, roomJID, true, affiliation, toChange, this);
    }
View Full Code Here

            return;
        }
        int[] rows = tabMembers.getSelectedRows();
        Vector toChange = new Vector(rows.length);
        for (int i=0; i<rows.length; i++) {
            XMUCUser u = tableModel.getUserAt(sorter.modelIndex(rows[i]));
             if (u.getRole() != role) {
                 toChange.add(u.getJID());
             }
        }
        new IQMUCSetList(backend, roomJID, false, role, toChange, this);
    }
View Full Code Here

     * IQMUCSetListListener interface
     */
    public void listSetOk(Vector jids, boolean aff, int value) {
        for (int i=0; i<jids.size(); i++) {
            JID jid = (JID)jids.get(i);
            XMUCUser oldUser = tableModel.getUser(jid);
            if (oldUser != null) {
                XMUCUser user;
                if (aff) {
                    user = new XMUCUser(jid, value, oldUser.getRole());
                } else {
                    user = new XMUCUser(jid, oldUser.getAffiliation(), value);
                }
                tableModel.addUser(user);
            }
        }
    }
View Full Code Here

        public int getColumnCount() {
            return columnNames.length;
        }

        public Object getValueAt(int row, int col) {
            XMUCUser user = (XMUCUser)data.get(row);
            switch(col) {
            case 0:
                return user.getJID().toStringNoResource();
            case 1:
                return user.getStringAffiliation();
            case 2:
                return user.getStringRole();
            }
            return null;
        }
View Full Code Here

            return false;
        }

        public void addUser(XMUCUser user) {
            for (int i=0; i<data.size(); i++) {
                XMUCUser oldUser = (XMUCUser)data.get(i);
                if(user.getJID()==null)break;
                if (user.getJID().equals(oldUser.getJID())) {
                    data.setElementAt(user, i);
                    fireTableRowsUpdated(i, i);
                    if (oldUser == selectedUser) {
                        selectedUser = user;
                        valueChanged(null);
View Full Code Here

            fireTableRowsInserted(data.size()-1, data.size()-1);
        }

        public XMUCUser getUser(JID jid) {
            for (int i=0; i<data.size(); i++) {
                XMUCUser user = (XMUCUser)data.get(i);
                if (jid.equals(user.getJID())) {
                    return user;
                }
            }
            return null;
        }
View Full Code Here

TOP

Related Classes of nu.fw.jeti.plugins.groupchat.elements.XMUCUser

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.