예제 #1
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;
    }
  }
예제 #2
0
 public static String xmlEscape(String text) {
   text = StringUtils.notNull(text);
   return Util.replace(text, unescapedChars, escapedChars, "\"'><&");
 }
예제 #3
0
 public static String notUrls(String str) {
   str = StringUtils.notNull(str);
   return (-1 != str.indexOf("http://")) ? "" : str;
 }
예제 #4
0
 private String getSubContactRealJid(String resource) {
   SubContact c = getExistSubContact(resource);
   return StringUtils.notNull((null == c) ? null : c.realJid);
 }