From d9cc0446b67892e269c3604ecb5d2fc1262a8eb3 Mon Sep 17 00:00:00 2001 From: Danny Baumann Date: Sat, 5 Jan 2013 13:59:16 +0100 Subject: [PATCH] Fix message overflow. --- src/com/fsck/k9/controller/MessagingController.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index 6576aca93..907571309 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -217,7 +217,7 @@ public class MessagingController implements Runnable { @Override public boolean add(Message m) { while (size() >= MAX_MESSAGES) { - Message dropped = super.remove(); + Message dropped = super.removeLast(); droppedMessages.add(0, dropped.makeMessageReference()); } super.add(0, m); @@ -4611,7 +4611,7 @@ public class MessagingController implements Runnable { keyguardService.inKeyguardRestrictedInputMode()) || (K9.getNotificationHideSubject() == NotificationHideSubject.ALWAYS) || summary.length() == 0) { - summary = new StringBuilder(context.getString(R.string.notification_new_title)); + summary = context.getString(R.string.notification_new_title); } NotificationManager notifMgr = @@ -4645,10 +4645,10 @@ public class MessagingController implements Runnable { getMessageSubject(context, m))); } if (!data.droppedMessages.isEmpty()) { - style.setSummaryText(context.getString( - R.string.notification_additional_messages, data.droppedMessages.size())); + style.setSummaryText(context.getString(R.string.notification_additional_messages, + data.droppedMessages.size(), accountDescr)); } - String title = context.getString(R.string.notification_new_messages_title, newMessages, accountDescr); + String title = context.getString(R.string.notification_new_messages_title, newMessages); style.setBigContentTitle(title); builder.setContentTitle(title); builder.setSubText(accountDescr);