From d73a77643d7923cae0789c5ed9f6a2a4cf41385f Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Thu, 23 Oct 2014 21:27:41 +0200 Subject: context menu for messages. allow to resend single messages --- .../conversations/services/XmppConnectionService.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/eu/siacs/conversations/services') diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 37e334eb..6d6c672e 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -1924,4 +1924,21 @@ public class XmppConnectionService extends Service { } } + + public void resendFailedMessages(Message message) { + List messages = new ArrayList(); + Message current = message; + while(current.getStatus() == Message.STATUS_SEND_FAILED) { + messages.add(current); + if (current.mergable(current.next())) { + current = current.next(); + } else { + break; + } + } + for(Message msg: messages) { + markMessage(msg, Message.STATUS_WAITING); + this.resendMessage(msg); + } + } } -- cgit v1.2.3