mirror of
https://github.com/moparisthebest/Conversations
synced 2024-12-01 05:02:21 -05:00
simulate old behaviour with messages being set to waiting while offline
This commit is contained in:
parent
c9b2638778
commit
9e26375d2f
@ -149,7 +149,6 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBind(final Account account) {
|
public void onBind(final Account account) {
|
||||||
resetSendingToWaiting(account);
|
|
||||||
account.getRoster().clearPresences();
|
account.getRoster().clearPresences();
|
||||||
fetchRosterFromServer(account);
|
fetchRosterFromServer(account);
|
||||||
fetchBookmarks(account);
|
fetchBookmarks(account);
|
||||||
|
@ -49,6 +49,7 @@ import eu.siacs.conversations.crypto.sasl.Plain;
|
|||||||
import eu.siacs.conversations.crypto.sasl.SaslMechanism;
|
import eu.siacs.conversations.crypto.sasl.SaslMechanism;
|
||||||
import eu.siacs.conversations.crypto.sasl.ScramSha1;
|
import eu.siacs.conversations.crypto.sasl.ScramSha1;
|
||||||
import eu.siacs.conversations.entities.Account;
|
import eu.siacs.conversations.entities.Account;
|
||||||
|
import eu.siacs.conversations.entities.Message;
|
||||||
import eu.siacs.conversations.generator.IqGenerator;
|
import eu.siacs.conversations.generator.IqGenerator;
|
||||||
import eu.siacs.conversations.services.XmppConnectionService;
|
import eu.siacs.conversations.services.XmppConnectionService;
|
||||||
import eu.siacs.conversations.utils.CryptoHelper;
|
import eu.siacs.conversations.utils.CryptoHelper;
|
||||||
@ -316,7 +317,7 @@ public class XmppConnection implements Runnable {
|
|||||||
+ ") enabled (resumable)");
|
+ ") enabled (resumable)");
|
||||||
} else {
|
} else {
|
||||||
Log.d(Config.LOGTAG, account.getJid().toBareJid().toString()
|
Log.d(Config.LOGTAG, account.getJid().toBareJid().toString()
|
||||||
+ ": stream managment(" + smVersion + ") enabled");
|
+ ": stream management(" + smVersion + ") enabled");
|
||||||
}
|
}
|
||||||
this.lastSessionStarted = SystemClock.elapsedRealtime();
|
this.lastSessionStarted = SystemClock.elapsedRealtime();
|
||||||
this.stanzasReceived = 0;
|
this.stanzasReceived = 0;
|
||||||
@ -343,6 +344,13 @@ public class XmppConnection implements Runnable {
|
|||||||
mStanzaQueue.clear();
|
mStanzaQueue.clear();
|
||||||
Log.d(Config.LOGTAG,"resending "+failedStanzas.size()+" stanzas");
|
Log.d(Config.LOGTAG,"resending "+failedStanzas.size()+" stanzas");
|
||||||
for(AbstractAcknowledgeableStanza packet : failedStanzas) {
|
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);
|
sendPacket(packet);
|
||||||
}
|
}
|
||||||
} catch (final NumberFormatException ignored) {
|
} catch (final NumberFormatException ignored) {
|
||||||
|
Loading…
Reference in New Issue
Block a user