Пример #1
0
 /**
  * Build is composing document
  *
  * @param status Status
  * @return XML document
  */
 public static String buildIsComposingInfo(boolean status) {
   String state = "idle";
   if (status) {
     state = "active";
   }
   return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
       + CRLF
       + "<isComposing xmlns=\"urn:ietf:params:xml:ns:im-iscomposing\""
       + CRLF
       + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
       + CRLF
       + "xsi:schemaLocation=\"urn:ietf:params:xml:ns:im-composing iscomposing.xsd\">"
       + CRLF
       + "<state>"
       + state
       + "</state>"
       + CRLF
       + "<contenttype>"
       + InstantMessage.MIME_TYPE
       + "</contenttype>"
       + CRLF
       + "<lastactive>"
       + DateUtils.encodeDate(System.currentTimeMillis())
       + "</lastactive>"
       + CRLF
       + "<refresh>60</refresh>"
       + CRLF
       + "</isComposing>";
 }
Пример #2
0
 public void setLastActiveDate(String lastActiveTimeStamp) {
   this.lastActiveDate = DateUtils.decodeDate(lastActiveTimeStamp) / 1000;
 }