diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-10-26 22:43:04 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-10-26 22:43:04 +0200 |
commit | 844d59566c5ee3b84ab240cab14119490e7eec2b (patch) | |
tree | db71961d882eaa197a1512d75d889768db767b3e /src/main/java/de/pixart/messenger/services | |
parent | fae5a658b9ea3c637c2158e60a1cd369ef4f912a (diff) |
add error message to failed messages. accessible via context menu
Diffstat (limited to 'src/main/java/de/pixart/messenger/services')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index d586bdd3f..993a6499e 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -3085,14 +3085,18 @@ public class XmppConnectionService extends Service { } public Message markMessage(final Account account, final Jid recipient, final String uuid, final int status) { - if (uuid == null) { + return markMessage(account, recipient, uuid, status, null); + } + + public Message markMessage(final Account account, final Jid recipient, final String uuid, final int status, String errorMessage) { + if (uuid == null) { return null; } for (Conversation conversation : getConversations()) { if (conversation.getJid().toBareJid().equals(recipient) && conversation.getAccount() == account) { final Message message = conversation.findSentMessageWithUuidOrRemoteId(uuid); if (message != null) { - markMessage(message, status); + markMessage(message, status, errorMessage); } return message; } @@ -3115,11 +3119,17 @@ public class XmppConnectionService extends Service { } public void markMessage(Message message, int status) { + markMessage(message, status, null); + } + + public void markMessage(Message message, int status, String errorMessage) { if (status == Message.STATUS_SEND_FAILED && (message.getStatus() == Message.STATUS_SEND_RECEIVED || message - .getStatus() == Message.STATUS_SEND_DISPLAYED)) { + .getStatus() == Message.STATUS_SEND_DISPLAYED) + && errorMessage == null) { return; } + message.setErrorMessage(errorMessage); message.setStatus(status); databaseBackend.updateMessage(message); updateConversationUi(); |