Package jnode.dto

Examples of jnode.dto.Echomail


   * @param fromName
   * @param toName
   */
  public static void writeEchomail(Echoarea area, String subject,
      String text, String fromName, String toName) {
    Echomail mail = new Echomail();
    mail.setFromFTN(getPrimaryFtnAddress().toString());
    mail.setFromName(fromName);
    mail.setArea(area);
    mail.setDate(new Date());
    mail.setPath("");
    mail.setSeenBy("");
    mail.setToName(toName);
    mail.setSubject(subject);
    mail.setMsgid(getPrimaryFtnAddress().toString() + " "
        + FtnTools.generate8d());
    StringBuilder b = new StringBuilder();
    b.append(String.format("\001PID: %s\n\001TID: %s\n\n",
        MainHandler.getVersion(), MainHandler.getVersion()));
    b.append(text);
    b.append("\n--- "
        + MainHandler.getCurrentInstance().getInfo().getStationName()
        + "\n");
    b.append(" * Origin: " + MainHandler.getVersion() + " ("
        + getPrimaryFtnAddress().toString() + ")\n");
    mail.setText(b.toString());
    ORMManager.get(Echomail.class).save(mail);
    if (mail.getId() != null) {
      for (Subscription s : ORMManager.get(Subscription.class).getAnd(
          "echoarea_id", "=", area)) {
        ORMManager.get(EchomailAwaiting.class).save(
            new EchomailAwaiting(s.getLink(), mail));
      }
View Full Code Here


                } catch (NntpException e) {
                    logger.l1("Can't save netmail.", e);
                }
            } else {
                try {
                    Echomail echomail = convertToEchomail(params);
                    // todo validate
                    dataProvider.post(auth, echomail);
                } catch (NntpException e) {
                    logger.l1("Can't save echomail.", e);
                }
View Full Code Here

        return response;
    }

    private Echomail convertToEchomail(Collection<String> params) {
        Echomail echomail = new Echomail();
        convertToMail(echomail, params);
        echomail.setArea(findEchoarea(params));
        echomail.setToName(findTo(params));
        echomail.setMsgid(echomail.getFromFTN() + " " + FtnTools.generate8d());
        return echomail;
    }
View Full Code Here

TOP

Related Classes of jnode.dto.Echomail

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.