diff -r d843b4fee5dc -r a788bf0e1080 src/org/sonews/storage/impl/DrupalDatabase.java --- a/src/org/sonews/storage/impl/DrupalDatabase.java Thu Oct 20 09:59:04 2011 +0200 +++ b/src/org/sonews/storage/impl/DrupalDatabase.java Thu Oct 20 10:50:58 2011 +0200 @@ -414,26 +414,16 @@ if (parentID == null || groupID == null) { throw new StorageBackendException("No valid In-Reply-To header was found → rejecting posted message."); } else { - if (m.isMimeType("text/plain")) { - Object content = m.getContent(); - if (content instanceof String) { - String subject = m.getSubject(); - String text = (String) content; - /** - * TODO: validovat a transformovat text - * (v současné době se o to stará až Drupal při výstupu) - */ - if (subject == null || subject.length() < 1) { - subject = text.substring(0, Math.min(10, text.length())); - } + String subject = m.getSubject(); + String text = m.getBodyXhtmlFragment(); - insertArticle(article.getAuthenticatedUser(), subject, text, parentID, groupID); - log.log(Level.INFO, "User ''{0}'' has posted an article", article.getAuthenticatedUser()); - } - } else { - throw new StorageBackendException("Only text/plain messages are supported for now – post it as plain text please."); + if (subject == null || subject.length() < 1) { + subject = text.substring(0, Math.min(10, text.length())); } + + insertArticle(article.getAuthenticatedUser(), subject, text, parentID, groupID); + log.log(Level.INFO, "User ''{0}'' has posted an article", article.getAuthenticatedUser()); } } catch (Exception e) { throw new StorageBackendException(e);