Example #1
0
 // #sijapp cond.if modules_CLIENTS is "true" #
 public void setClient(String resource, String caps) {
   SubContact c = getExistSubContact(resource);
   if (null != c) {
     c.client = XmppClient.createClient(caps);
   }
   SubContact cur = getCurrentSubContact();
   setClient((null == cur) ? ClientInfo.CLI_NONE : cur.client, null);
 }
Example #2
0
 protected SubContact getSubContact(String resource) {
   SubContact c = getExistSubContact(resource);
   if (null != c) {
     return c;
   }
   c = new SubContact();
   c.resource = resource;
   c.status = StatusInfo.STATUS_OFFLINE;
   subContacts.addElement(c);
   return c;
 }
Example #3
0
 private void removeSubContact(String resource) {
   for (int i = subContacts.size() - 1; i >= 0; --i) {
     SubContact c = (SubContact) subContacts.elementAt(i);
     if (c.resource.equals(resource)) {
       c.status = StatusInfo.STATUS_OFFLINE;
       c.statusText = null;
       subContacts.removeElementAt(i);
       return;
     }
   }
 }
Example #4
0
  public void __setStatus(String resource, int priority, byte index, String statusText) {
    if (StatusInfo.STATUS_OFFLINE == index) {
      resource = StringUtils.notNull(resource);
      if (resource.equals(currentResource)) {
        currentResource = null;
      }
      removeSubContact(resource);
      if (0 == subContacts.size()) {
        setOfflineStatus();
      }

    } else {
      SubContact c = getSubContact(resource);
      c.priority = (byte) Math.min(127, Math.max(priority, -127));
      c.status = index;
      c.statusText = statusText;
    }
  }
Example #5
0
 void setRealJid(String resource, String realJid) {
   SubContact c = getExistSubContact(resource);
   if (null != c) {
     c.realJid = realJid;
   }
 }