private void internalAddStatus(Status status) throws IOException {
    XContentBuilder jsonifiedObject;

    jsonifiedObject =
        XContentFactory.jsonBuilder()
            .startObject()
            .field("username", status.getUsername())
            .field("domain", status.getDomain())
            .field("statusDate", status.getStatusDate())
            .field("content", status.getContent())
            .endObject();

    addObject(status.getClass(), status.getStatusId(), jsonifiedObject);
  }
Beispiel #2
0
  @Async
  public void sendUserMentionEmail(Status status, User mentionnedUser) {
    if (log.isDebugEnabled()) {
      log.debug(
          "Sending Mention e-mail to User '"
              + mentionnedUser.getLogin()
              + "' with locale : '"
              + locale
              + "'");
    }
    String url =
        tatamiUrl + "/tatami/profile/" + status.getUsername() + "/#/status/" + status.getStatusId();

    Map<String, Object> model = new HashMap<String, Object>();
    model.put("user", mentionnedUser);
    model.put("status", status);
    model.put("statusUrl", url);

    sendTextFromTemplate(mentionnedUser, model, "userMention", this.locale);
  }