Examples of Roster


Examples of org.jivesoftware.openfire.roster.Roster

            PrivacyItem newItem = new PrivacyItem(itemElement);
            items.add(newItem);
            // If the user's roster is required to evaluation whether a packet must be blocked
            // then ensure that the roster is available
            if (newItem.isRosterRequired()) {
                Roster roster = getRoster();
                if (roster == null) {
                    Log.warn("Privacy item removed since roster of user was not found: " + userJID.getNode());
                    items.remove(newItem);
                }
            }
View Full Code Here

Examples of org.jivesoftware.openfire.roster.Roster

        // Get the roster of the node owner
        XMPPServer server = XMPPServer.getInstance();
        // Check that the node owner is a local user
        if (server.isLocal(nodeOwner)) {
            try {
                Roster roster = server.getRosterManager().getRoster(nodeOwner.getNode());
                RosterItem item = roster.getRosterItem(owner);
                // Check that the subscriber is subscribe to the node owner's presence
                boolean isSubscribed = item != null && (
                        RosterItem.SUB_BOTH == item.getSubStatus() ||
                                RosterItem.SUB_FROM == item.getSubStatus());
                if (isSubscribed) {
View Full Code Here

Examples of org.jivesoftware.openfire.roster.Roster

        // Get the roster of the node owner
        XMPPServer server = XMPPServer.getInstance();
        // Check that the node owner is a local user
        if (server.isLocal(nodeOwner)) {
            try {
                Roster roster = server.getRosterManager().getRoster(nodeOwner.getNode());
                RosterItem item = roster.getRosterItem(owner);
                // Check that the subscriber is subscribe to the node owner's presence
                return item != null && (RosterItem.SUB_BOTH == item.getSubStatus() ||
                        RosterItem.SUB_FROM == item.getSubStatus());
            }
            catch (UserNotFoundException e) {
View Full Code Here

Examples of org.jivesoftware.smack.Roster

  add(sendFileItem);

        final String userId = window.getBuddy().getUser();

        try {
            Roster are = BuddyList.getInstance().getConnection().getRoster();
            if ( !( window instanceof ConsolePanel ) && !are.contains( userId ) ) {
                add(addperson);
            }
        }
        catch( NullPointerException ex ){ }
View Full Code Here

Examples of org.jivesoftware.smack.Roster

     *  Gets the different available RosterGroups
     *
     *@return    an array of strings representing the RosterGroups
     */
    private String[] getRosterGroups() {
        Roster roster = ConnectorThread.getInstance().getRoster();
        String rosterGroups[] = new String[roster.getGroupCount() + 2];

        int i = 0;

        if ((!currentGroup.equals(""))) {
            rosterGroups[i] = currentGroup;
            i++;
        }

        rosterGroups[i++] = resources.getString("none");
        rosterGroups[i++] = resources.getString("newGroup");

        Iterator iterator = roster.getGroups();
        while (iterator.hasNext()) {
            RosterGroup rosterGroup = (RosterGroup) iterator.next();
            if ((currentGroup.equals(""))
                     || (!rosterGroup.getName().equals(currentGroup))) {
                rosterGroups[i] = rosterGroup.getName();
View Full Code Here

Examples of org.jivesoftware.smack.Roster

     *@param  groupName   the group to put the buddy in
     *@param  buddyAlias  the alias of the buddy
     *@param  buddyId     the buddy's JID
     */
    private void addBuddy(String groupName, String buddyAlias, String buddyId) {
        Roster buddyGroups = ConnectorThread.getInstance()
                .getRoster();

        WaitDialog wait = new WaitDialog(this, null, resources.getString("pleaseWait"));
        wait.setVisible(true);
        setVisible(false);
View Full Code Here

Examples of org.jivesoftware.smack.Roster

        /**
         *  Called by the enclosing Thread - will attempt to add the buddy to
         *  the Roster, and will display an error if it wasn't successfull
         */
        public void run() {
            final Roster roster = BuddyList.getInstance().getConnection().getRoster();
            final BuddyStatus buddy = BuddyList.getInstance().getBuddyStatus(
                    buddyId);
            if (modify) {
                SwingUtilities.invokeLater(
                    new Runnable() {
                        public void run() {
                            BuddyList.getInstance().getBuddyListTree().removeBuddy(
                                    buddy, buddy.getGroup(), true);
                        }
                    });
            }

            try {


                if (modify) {
                    com.valhalla.Logger.debug("modifying roster item");
                    RosterEntry entry = buddy.getRosterEntry();
                    entry.setName(buddyAlias);
                    int c = 0;
                    Iterator groups = entry.getGroups();
                    while (groups.hasNext()) {
                        RosterGroup g = (RosterGroup) groups.next();
                        if(!g.contains(entry)) continue;
                        g.removeEntry(entry);
                        c++;
                    }

                    buddy.setTempGroup(groupName);
                    SwingUtilities.invokeLater(new Runnable()
                    {
                        public void run()
                        {
                            dialog.setVisible(false);
                            buddy.setRemoved(false);

                            NMOptionDialog.createMessageDialog(null, resources.getString("addBuddyDialogTitle"), resources.getString("buddyAdded"));

                            BuddyList.getInstance().getBuddyListTree().addBuddy(
                                    buddy);
                        }
                    });

                    if (groupName != null && !groupName.equals("")) {
                        RosterGroup newGroup = null;
                        newGroup = roster.getGroup(groupName);
                        if (newGroup == null) {
                            com.valhalla.Logger.debug("had to create new group" + groupName);
                            newGroup = roster.createGroup(groupName);
                        } else {
                            com.valhalla.Logger.debug("found group " + newGroup.getName());
                        }

                        if (c != 0) {
                            com.valhalla.Logger.debug("Moving buddy to " + newGroup.getName());
                            newGroup.addEntry(entry);
                        } else {
                            roster.createEntry(buddyId, buddyAlias,
                                    new String[]{groupName});

                        }
                    }
                }
                /*
                 *  if it's a new entry
                 */else {

                    if (groupName == null) {
                        roster.createEntry(buddyId, buddyAlias, null);
                    } else {
                        roster.createEntry(buddyId, buddyAlias,
                                new String[]{groupName});
                        buddy.setTempGroup(groupName);
                    }

                    SwingUtilities.invokeLater(new Runnable()
View Full Code Here

Examples of org.jivesoftware.smack.Roster

    return args.getThemeTemplate("goim/stats/showstatus.vm");
    //args.printMessage(formatPresence(presence) + (presence == null ? "" : "<br/><br/>Full XML: " + presence.toXML().replace("<","&lt;").replace(">","&gt;")));
  }
  @AddinInterfaceMethodDefinition(userlevel = -1)
  public Template showRoster(HTTPModule.Args args) {
    Roster roster = bot.getRoster();
    args.context.put("roster",roster);
    args.context.put("statsWebInterface",this);
    if(args.req.getValue("showOffline","").equals("1"))
      args.context.put("showOffline","1");
    return args.getThemeTemplate("goim/stats/showroster.vm");
View Full Code Here

Examples of org.jivesoftware.smack.Roster

      }
    });
    //image.setMenu(contextMenu);
  }
  protected void updateAccountRoster(GOIMAccount account) {
    Roster roster = account.xmpp.getRoster();
    if(roster == null) return;
    Iterator groups = roster.getGroups();
    Section sec = sections.get(account);
    Control[] controls = ((Composite)sec.getClient()).getChildren();
    for(int i = 0 ; i < controls.length ; i++)
      if(controls[i] instanceof Section) controls[i].dispose();
    while(groups.hasNext()) {
      RosterGroup group = (RosterGroup)groups.next();
      Section groupSec = createGroupSection((Composite) sec.getClient(),group.getName());
      Iterator entries = group.getEntries();
      while(entries.hasNext()) {
        RosterEntry entry = (RosterEntry)entries.next();
        createRosterEntry(tk,account,roster, (Composite)groupSec.getClient(),entry,null);
      }
    }
    Section defaultSec = createGroupSection((Composite) sec.getClient(),"Default");
    Iterator entries = roster.getUnfiledEntries();
    while(entries.hasNext()) {
      RosterEntry entry = (RosterEntry)entries.next();
      createRosterEntry(tk,account,roster, (Composite)defaultSec.getClient(), entry,null);
    }
    ((Composite)sec.getClient()).layout(true);
View Full Code Here

Examples of org.jivesoftware.smack.Roster

    if (chat == null) {
      jiddisplay = StringUtils.parseResource(jid);
      if (jiddisplay.equals(""))
        jiddisplay = jid;
    } else {
      Roster roster = account.xmpp.getRoster();
      if(roster != null) {
        RosterEntry entry = roster.getEntry(StringUtils
            .parseBareAddress(jid));
        if (entry != null && entry.getName() != null)
          jiddisplay = entry.getName();
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.