1.1 --- a/src/org/sonews/storage/impl/DrupalDatabase.java Thu Oct 20 09:59:04 2011 +0200
1.2 +++ b/src/org/sonews/storage/impl/DrupalDatabase.java Thu Oct 20 10:50:58 2011 +0200
1.3 @@ -414,26 +414,16 @@
1.4 if (parentID == null || groupID == null) {
1.5 throw new StorageBackendException("No valid In-Reply-To header was found → rejecting posted message.");
1.6 } else {
1.7 - if (m.isMimeType("text/plain")) {
1.8 - Object content = m.getContent();
1.9 - if (content instanceof String) {
1.10 - String subject = m.getSubject();
1.11 - String text = (String) content;
1.12
1.13 - /**
1.14 - * TODO: validovat a transformovat text
1.15 - * (v současné době se o to stará až Drupal při výstupu)
1.16 - */
1.17 - if (subject == null || subject.length() < 1) {
1.18 - subject = text.substring(0, Math.min(10, text.length()));
1.19 - }
1.20 + String subject = m.getSubject();
1.21 + String text = m.getBodyXhtmlFragment();
1.22
1.23 - insertArticle(article.getAuthenticatedUser(), subject, text, parentID, groupID);
1.24 - log.log(Level.INFO, "User ''{0}'' has posted an article", article.getAuthenticatedUser());
1.25 - }
1.26 - } else {
1.27 - throw new StorageBackendException("Only text/plain messages are supported for now – post it as plain text please.");
1.28 + if (subject == null || subject.length() < 1) {
1.29 + subject = text.substring(0, Math.min(10, text.length()));
1.30 }
1.31 +
1.32 + insertArticle(article.getAuthenticatedUser(), subject, text, parentID, groupID);
1.33 + log.log(Level.INFO, "User ''{0}'' has posted an article", article.getAuthenticatedUser());
1.34 }
1.35 } catch (Exception e) {
1.36 throw new StorageBackendException(e);