コード例 #1
0
 private void sendOfflineMessage(JID receipient, OfflineMessage offlineMessage) {
   Element offlineInfo = offlineMessage.addChildElement("offline", NAMESPACE);
   offlineInfo
       .addElement("item")
       .addAttribute("node", XMPPDateTimeFormat.format(offlineMessage.getCreationDate()));
   routingTable.routePacket(receipient, offlineMessage, true);
 }
コード例 #2
0
  public Iterator<DiscoItem> getItems(String name, String node, JID senderJID) {
    // Mark that offline messages shouldn't be sent when the user becomes available
    stopOfflineFlooding(senderJID);
    List<DiscoItem> answer = new ArrayList<DiscoItem>();
    for (OfflineMessage offlineMessage : messageStore.getMessages(senderJID.getNode(), false)) {
      answer.add(
          new DiscoItem(
              senderJID.asBareJID(),
              offlineMessage.getFrom().toString(),
              XMPPDateTimeFormat.format(offlineMessage.getCreationDate()),
              null));
    }

    return answer.iterator();
  }