diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-08-19 13:00:52 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-08-19 13:00:52 +0200 |
commit | 9e26375d2fcad898c2c4e82366725d8e78710e8e (patch) | |
tree | b3a4268024394facbb164dd8cce2ceaea65dc949 /src/main/java/eu/siacs/conversations | |
parent | c9b2638778237b128879bb638932414beef81a4d (diff) |
simulate old behaviour with messages being set to waiting while offline
Diffstat (limited to 'src/main/java/eu/siacs/conversations')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 1 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 12 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 0ffe4e37f..e0f8d8d23 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -149,7 +149,6 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa @Override public void onBind(final Account account) { - resetSendingToWaiting(account); account.getRoster().clearPresences(); fetchRosterFromServer(account); fetchBookmarks(account); diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 46daf5774..e2c9e25ff 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -49,6 +49,7 @@ import eu.siacs.conversations.crypto.sasl.Plain; import eu.siacs.conversations.crypto.sasl.SaslMechanism; import eu.siacs.conversations.crypto.sasl.ScramSha1; import eu.siacs.conversations.entities.Account; +import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.generator.IqGenerator; import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.utils.CryptoHelper; @@ -316,7 +317,7 @@ public class XmppConnection implements Runnable { + ") enabled (resumable)"); } else { Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() - + ": stream managment(" + smVersion + ") enabled"); + + ": stream management(" + smVersion + ") enabled"); } this.lastSessionStarted = SystemClock.elapsedRealtime(); this.stanzasReceived = 0; @@ -343,6 +344,13 @@ public class XmppConnection implements Runnable { mStanzaQueue.clear(); Log.d(Config.LOGTAG,"resending "+failedStanzas.size()+" stanzas"); for(AbstractAcknowledgeableStanza packet : failedStanzas) { + if (packet instanceof MessagePacket) { + MessagePacket message = (MessagePacket) packet; + mXmppConnectionService.markMessage(account, + message.getTo().toBareJid(), + message.getId(), + Message.STATUS_UNSEND); + } sendPacket(packet); } } catch (final NumberFormatException ignored) { @@ -764,7 +772,7 @@ public class XmppConnection implements Runnable { sendServiceDiscoveryInfo(account.getServer()); sendServiceDiscoveryInfo(account.getJid().toBareJid()); sendServiceDiscoveryItems(account.getServer()); - Log.d(Config.LOGTAG, account.getJid().toBareJid()+ ": online with resource " + account.getResource()); + Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": online with resource " + account.getResource()); changeStatus(Account.State.ONLINE); if (bindListener != null) { bindListener.onBind(account); |