diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-04-11 09:13:56 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-04-11 09:13:56 +0200 |
commit | 51100ab48b94c55f8cce981c422e50a607f261ad (patch) | |
tree | f23ad4ad4e8256dd0db7deca347364bbdc76a295 /src/eu/siacs/conversations/utils | |
parent | 644473205ab261157f500470d496999db665d75f (diff) |
failed messages get now marked inline
Diffstat (limited to 'src/eu/siacs/conversations/utils')
-rw-r--r-- | src/eu/siacs/conversations/utils/MessageParser.java | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/eu/siacs/conversations/utils/MessageParser.java b/src/eu/siacs/conversations/utils/MessageParser.java index 936d0e9a5..568386d5f 100644 --- a/src/eu/siacs/conversations/utils/MessageParser.java +++ b/src/eu/siacs/conversations/utils/MessageParser.java @@ -149,19 +149,9 @@ public class MessageParser { return new Message(conversation,fullJid, message.findChild("body").getContent(), Message.ENCRYPTION_NONE,status); } - public static Message parseError(MessagePacket packet, Account account, XmppConnectionService service) { - - String[] fromParts = packet.getFrom().split("/"); - Conversation conversation = service.findOrCreateConversation(account, fromParts[0],false); - Element error = packet.findChild("error"); - String errorName = error.getChildren().get(0).getName(); - String displayError; - if (errorName.equals("service-unavailable")) { - displayError = "Contact is offline and does not have offline storage"; - } else { - displayError = errorName.replace("-", " "); - } - return new Message(conversation, packet.getFrom(), displayError, Message.ENCRYPTION_NONE, Message.STATUS_ERROR); + public static void parseError(MessagePacket packet, Account account, XmppConnectionService service) { + String[] fromParts = packet.getFrom().split("/"); + service.markMessage(account, fromParts[0], packet.getId(), Message.STATUS_SEND_FAILED); } public static String getPgpBody(MessagePacket packet) { |