src/org/sonews/storage/impl/DrupalDatabase.java
changeset 116 4ddc1020a154
parent 103 a788bf0e1080
child 117 79ce65d63cce
     1.1 --- a/src/org/sonews/storage/impl/DrupalDatabase.java	Thu Oct 20 10:50:58 2011 +0200
     1.2 +++ b/src/org/sonews/storage/impl/DrupalDatabase.java	Sun Nov 06 00:08:05 2011 +0100
     1.3 @@ -419,7 +419,11 @@
     1.4  					String text = m.getBodyXhtmlFragment();
     1.5  
     1.6  					if (subject == null || subject.length() < 1) {
     1.7 -						subject = text.substring(0, Math.min(10, text.length()));
     1.8 +						String plainText = m.getBodyPlainText();
     1.9 +						subject = plainText.substring(0, Math.min(32, plainText.length()));
    1.10 +						if (subject.length() < plainText.length()) {
    1.11 +							subject = subject + "…";
    1.12 +						}
    1.13  					}
    1.14  
    1.15  					insertArticle(article.getAuthenticatedUser(), subject, text, parentID, groupID);