src/org/sonews/storage/DrupalMessage.java
changeset 118 ba7ea56fd672
parent 116 4ddc1020a154
     1.1 --- a/src/org/sonews/storage/DrupalMessage.java	Sun Nov 06 00:08:05 2011 +0100
     1.2 +++ b/src/org/sonews/storage/DrupalMessage.java	Mon Nov 07 17:47:10 2011 +0100
     1.3 @@ -65,7 +65,7 @@
     1.4   * 
     1.5   * Also add header and body separate serialization.
     1.6   * 
     1.7 - * And can be deserialized from SQL ResultSet
     1.8 + * And can be deserialized from SQL ResultSet or an Article
     1.9   * 
    1.10   * @author František Kučera (frantovo.cz)
    1.11   */
    1.12 @@ -75,13 +75,14 @@
    1.13  	 * If body of message posted by user through NNTP starts with this text,
    1.14  	 * it will be treated as formated text in Markdown syntax.
    1.15  	 */
    1.16 -	private static final String MARKDOWN_HEADER = "#!markdown\r\n";
    1.17  	private static final Logger log = Logger.getLogger(DrupalMessage.class.getName());
    1.18  	private static final String MESSAGE_ID_HEADER = "Message-ID";
    1.19  	private static final String CRLF = "\r\n";
    1.20  	public static final String CHARSET = "UTF-8";
    1.21  	private static final String XHTML_CONTENT_TYPE = "text/html; charset=" + CHARSET;
    1.22  	private static final String ZNAKČKA_KONCE_ŘÁDKU = "◆";
    1.23 +	private static final String MARKDOWN_HEADER = "#!markdown\r\n";
    1.24 +	private static final String SIGNATURE_BLOCK = "\r\n-- \r\n";
    1.25  	private String messageID;
    1.26  	private Long parentID;
    1.27  	private Long groupID;
    1.28 @@ -335,6 +336,7 @@
    1.29  		inputText = označKonceŘádků(inputText);
    1.30  
    1.31  		Runtime r = Runtime.getRuntime();
    1.32 +		// TODO: spouštět přes sudo jako Markdown
    1.33  		Process p = r.exec(new String[]{"tidy", // http://tidy.sourceforge.net
    1.34  					"-asxml", // well formed XHTML
    1.35  					"-numeric", // číselné entity
    1.36 @@ -530,7 +532,10 @@
    1.37  	 */
    1.38  	public String getBodyXhtmlFragment() throws StorageBackendException {
    1.39  		/**
    1.40 -		 * TODO: podporovat i zprávy přímo v HTML a multipart.
    1.41 +		 * TODO: 
    1.42 +		 *  - tohle dělat už v konstruktoru a pak už mít všechno stejné, ať už jde o zprávu přijatou od NNTP uživatele nebo načtenou z DB
    1.43 +		 *	- podporovat i zprávy přímo v HTML a multipart.
    1.44 +		 *	- ořezávat podpis (SIGNATURE_BLOCK)
    1.45  		 */
    1.46  		try {
    1.47  			Object c = getContent();