# HG changeset patch # User František Kučera # Date 1320684430 -3600 # Node ID ba7ea56fd672ae91c3427bb058fa79f99db9d772 # Parent 79ce65d63cce21fca65d778bbae1db1f3ce408d6 drobnosti, TODO diff -r 79ce65d63cce -r ba7ea56fd672 src/org/sonews/acl/AuthInfoCommand.java --- a/src/org/sonews/acl/AuthInfoCommand.java Mon Nov 07 17:35:43 2011 +0100 +++ b/src/org/sonews/acl/AuthInfoCommand.java Mon Nov 07 17:47:10 2011 +0100 @@ -49,6 +49,7 @@ @Override public boolean isStateful() { + // TODO: make it statefull? return false; } @@ -76,6 +77,7 @@ } else { char[] password = commandMatcher.group(2).toCharArray(); + // TODO: StorageManager should return User object instead of boolean (so there could be transferred some additional information about user) boolean goodPassword = StorageManager.current().authenticateUser(conn.getUser().getUserName(), password); Arrays.fill(password, '*'); commandMatcher = null; diff -r 79ce65d63cce -r ba7ea56fd672 src/org/sonews/storage/DrupalMessage.java --- a/src/org/sonews/storage/DrupalMessage.java Mon Nov 07 17:35:43 2011 +0100 +++ b/src/org/sonews/storage/DrupalMessage.java Mon Nov 07 17:47:10 2011 +0100 @@ -65,7 +65,7 @@ * * Also add header and body separate serialization. * - * And can be deserialized from SQL ResultSet + * And can be deserialized from SQL ResultSet or an Article * * @author František Kučera (frantovo.cz) */ @@ -75,13 +75,14 @@ * If body of message posted by user through NNTP starts with this text, * it will be treated as formated text in Markdown syntax. */ - private static final String MARKDOWN_HEADER = "#!markdown\r\n"; private static final Logger log = Logger.getLogger(DrupalMessage.class.getName()); private static final String MESSAGE_ID_HEADER = "Message-ID"; private static final String CRLF = "\r\n"; public static final String CHARSET = "UTF-8"; private static final String XHTML_CONTENT_TYPE = "text/html; charset=" + CHARSET; private static final String ZNAKČKA_KONCE_ŘÁDKU = "◆"; + private static final String MARKDOWN_HEADER = "#!markdown\r\n"; + private static final String SIGNATURE_BLOCK = "\r\n-- \r\n"; private String messageID; private Long parentID; private Long groupID; @@ -335,6 +336,7 @@ inputText = označKonceŘádků(inputText); Runtime r = Runtime.getRuntime(); + // TODO: spouštět přes sudo jako Markdown Process p = r.exec(new String[]{"tidy", // http://tidy.sourceforge.net "-asxml", // well formed XHTML "-numeric", // číselné entity @@ -530,7 +532,10 @@ */ public String getBodyXhtmlFragment() throws StorageBackendException { /** - * TODO: podporovat i zprávy přímo v HTML a multipart. + * TODO: + * - 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 + * - podporovat i zprávy přímo v HTML a multipart. + * - ořezávat podpis (SIGNATURE_BLOCK) */ try { Object c = getContent();