src/org/sonews/storage/impl/DrupalDatabase.java
changeset 106 dc04a3c2c557
parent 103 a788bf0e1080
child 117 79ce65d63cce
     1.1 --- a/src/org/sonews/storage/impl/DrupalDatabase.java	Fri Oct 21 18:21:30 2011 +0200
     1.2 +++ b/src/org/sonews/storage/impl/DrupalDatabase.java	Sun Oct 23 23:37:39 2011 +0200
     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);