drobnosti, TODO
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon, 07 Nov 2011 17:47:10 +0100
changeset 118ba7ea56fd672
parent 117 79ce65d63cce
child 119 f5b57e221e38
drobnosti, TODO
src/org/sonews/acl/AuthInfoCommand.java
src/org/sonews/storage/DrupalMessage.java
     1.1 --- a/src/org/sonews/acl/AuthInfoCommand.java	Mon Nov 07 17:35:43 2011 +0100
     1.2 +++ b/src/org/sonews/acl/AuthInfoCommand.java	Mon Nov 07 17:47:10 2011 +0100
     1.3 @@ -49,6 +49,7 @@
     1.4  
     1.5  	@Override
     1.6  	public boolean isStateful() {
     1.7 +		// TODO: make it statefull?
     1.8  		return false;
     1.9  	}
    1.10  
    1.11 @@ -76,6 +77,7 @@
    1.12  				} else {
    1.13  
    1.14  					char[] password = commandMatcher.group(2).toCharArray();
    1.15 +					// TODO: StorageManager should return User object instead of boolean (so there could be transferred some additional information about user)
    1.16  					boolean goodPassword = StorageManager.current().authenticateUser(conn.getUser().getUserName(), password);
    1.17  					Arrays.fill(password, '*');
    1.18  					commandMatcher = null;
     2.1 --- a/src/org/sonews/storage/DrupalMessage.java	Mon Nov 07 17:35:43 2011 +0100
     2.2 +++ b/src/org/sonews/storage/DrupalMessage.java	Mon Nov 07 17:47:10 2011 +0100
     2.3 @@ -65,7 +65,7 @@
     2.4   * 
     2.5   * Also add header and body separate serialization.
     2.6   * 
     2.7 - * And can be deserialized from SQL ResultSet
     2.8 + * And can be deserialized from SQL ResultSet or an Article
     2.9   * 
    2.10   * @author František Kučera (frantovo.cz)
    2.11   */
    2.12 @@ -75,13 +75,14 @@
    2.13  	 * If body of message posted by user through NNTP starts with this text,
    2.14  	 * it will be treated as formated text in Markdown syntax.
    2.15  	 */
    2.16 -	private static final String MARKDOWN_HEADER = "#!markdown\r\n";
    2.17  	private static final Logger log = Logger.getLogger(DrupalMessage.class.getName());
    2.18  	private static final String MESSAGE_ID_HEADER = "Message-ID";
    2.19  	private static final String CRLF = "\r\n";
    2.20  	public static final String CHARSET = "UTF-8";
    2.21  	private static final String XHTML_CONTENT_TYPE = "text/html; charset=" + CHARSET;
    2.22  	private static final String ZNAKČKA_KONCE_ŘÁDKU = "◆";
    2.23 +	private static final String MARKDOWN_HEADER = "#!markdown\r\n";
    2.24 +	private static final String SIGNATURE_BLOCK = "\r\n-- \r\n";
    2.25  	private String messageID;
    2.26  	private Long parentID;
    2.27  	private Long groupID;
    2.28 @@ -335,6 +336,7 @@
    2.29  		inputText = označKonceŘádků(inputText);
    2.30  
    2.31  		Runtime r = Runtime.getRuntime();
    2.32 +		// TODO: spouštět přes sudo jako Markdown
    2.33  		Process p = r.exec(new String[]{"tidy", // http://tidy.sourceforge.net
    2.34  					"-asxml", // well formed XHTML
    2.35  					"-numeric", // číselné entity
    2.36 @@ -530,7 +532,10 @@
    2.37  	 */
    2.38  	public String getBodyXhtmlFragment() throws StorageBackendException {
    2.39  		/**
    2.40 -		 * TODO: podporovat i zprávy přímo v HTML a multipart.
    2.41 +		 * TODO: 
    2.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
    2.43 +		 *	- podporovat i zprávy přímo v HTML a multipart.
    2.44 +		 *	- ořezávat podpis (SIGNATURE_BLOCK)
    2.45  		 */
    2.46  		try {
    2.47  			Object c = getContent();