Package net.kano.joustsim.oscar

Examples of net.kano.joustsim.oscar.BuddyInfoManager


  }

  public String[] getGroupNames() {
    String[] groupNames;
    if (_connected && _conn != null) {
      BuddyInfoManager buddyInfoManager = _conn.getBuddyInfoManager();
      SsiService ssiService = _conn.getSsiService();
      MutableBuddyList buddyList = ssiService.getBuddyList();
      List groupsList = buddyList.getGroups();
      groupNames = new String[groupsList.size()];
      int groupNum = 0;
View Full Code Here


  }

  public String[] getBuddiesInGroupNamed(String groupName) {
    String[] buddyNames = null;
    if (_connected && _conn != null) {
      BuddyInfoManager buddyInfoManager = _conn.getBuddyInfoManager();
      SsiService ssiService = _conn.getSsiService();
      MutableBuddyList buddyList = ssiService.getBuddyList();
      List groupsList = buddyList.getGroups();
      Iterator groupsIter = groupsList.iterator();
      while (groupsIter.hasNext()) {
View Full Code Here

  }

  public void removeBuddy(String buddyName) {
    if (_connected && _conn != null) {
      Screenname buddyScreenName = new Screenname(buddyName);
      BuddyInfoManager buddyInfoManager = _conn.getBuddyInfoManager();
      SsiService ssiService = _conn.getSsiService();
      MutableBuddyList buddyList = ssiService.getBuddyList();
      List groups = buddyList.getGroups();
      Iterator groupsIter = groups.iterator();
      while (groupsIter.hasNext()) {
View Full Code Here

  public BuddyInfo _addBuddyIfNecessary(String buddyName) {
    BuddyInfo buddyInfo = null;
    if (_connected && _conn != null) {
      Screenname buddy = new Screenname(buddyName);
      BuddyInfoManager buddyInfoManager = _conn.getBuddyInfoManager();
      buddyInfo = buddyInfoManager.getBuddyInfo(buddy);
      boolean isOnBuddyList = false;
      if (buddyInfo != null) {
        isOnBuddyList = buddyInfo.isOnBuddyList();
      }
      if (!isOnBuddyList) {
        SsiService ssiService = _conn.getSsiService();
        MutableBuddyList buddyList = ssiService.getBuddyList();
        List groups = buddyList.getGroups();
        if (groups.size() == 0) {
          buddyList.addGroup("Buddies");
          groups = buddyList.getGroups();
        }
        MutableGroup group = (MutableGroup) groups.get(0);
        group.addBuddy(buddyName);

        for (int attempt = 0; attempt < 10 && !buddyInfo.isOnBuddyList(); attempt++) {
          try {
            Thread.sleep(100);
          }
          catch (Throwable t) {
            // ignore
          }
          buddyInfo = buddyInfoManager.getBuddyInfo(buddy);
        }
      }
    }
    return buddyInfo;
  }
View Full Code Here

TOP

Related Classes of net.kano.joustsim.oscar.BuddyInfoManager

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.