~singpolyma/cheogram-android

15f11a81f347e09bf85d29c84ba5278c93dd1edf — Daniel Gultsch 2 months ago c9b48ec
fix stanza counting error after inline SM enable
1 files changed, 5 insertions(+), 3 deletions(-)

M src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
M src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java => src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +5 -3
@@ 993,7 993,8 @@ public class XmppConnection implements Runnable {

    private void resetOutboundStanzaQueue() {
        synchronized (this.mStanzaQueue) {
            final List<AbstractAcknowledgeableStanza> intermediateStanzas = new ArrayList<>();
            final ImmutableList.Builder<AbstractAcknowledgeableStanza> intermediateStanzasBuilder =
                    new ImmutableList.Builder<>();
            if (Config.EXTENDED_SM_LOGGING) {
                Log.d(
                        Config.LOGTAG,


@@ 1004,12 1005,13 @@ public class XmppConnection implements Runnable {
            for (int i = this.stanzasSentBeforeAuthentication + 1; i <= this.stanzasSent; ++i) {
                final AbstractAcknowledgeableStanza stanza = this.mStanzaQueue.get(i);
                if (stanza != null) {
                    intermediateStanzas.add(stanza);
                    intermediateStanzasBuilder.add(stanza);
                }
            }
            this.mStanzaQueue.clear();
            final var intermediateStanzas = intermediateStanzasBuilder.build();
            for (int i = 0; i < intermediateStanzas.size(); ++i) {
                this.mStanzaQueue.put(i, intermediateStanzas.get(i));
                this.mStanzaQueue.append(i + 1, intermediateStanzas.get(i));
            }
            this.stanzasSent = intermediateStanzas.size();
            if (Config.EXTENDED_SM_LOGGING) {