AnsweredAssumed Answered

Bug: addStanzaIdAcknowledgedListener not working

Question asked by andrejvanderzee on Jan 17, 2015
Latest reply on Jan 18, 2015 by andrejvanderzee

Hi,

 

This code is not working as expected:

 

       connection.addPacketSendingListener(new PacketListener() {

            @Override

            public void processPacket(Packet packet) throws SmackException.NotConnectedException {

                try {

                    connection.addStanzaIdAcknowledgedListener(packet.getPacketID(), new PacketListener() {

                        @Override

                        public void processPacket(Packet packet) throws SmackException.NotConnectedException {

                            Log.d(TAG, "Received ACK for packet " + packet.getPacketID());

                        }

                    });

                    Log.d(TAG, "Registered Stream Management ACK listener for stanza ID " + packet.getPacketID());

                } catch (StreamManagementException.StreamManagementNotEnabledException e) {

                    Log.e(TAG, "Failed to add ack listener for stanza ID " + packet.getPacketID(), e);

                }

            }

        }, MessageTypeFilter.CHAT);

 

The listener is registered, but never called.

 

In XMPPTCPConnection.processHandledCount() on line number 1664 it sais StringUtils.isNotEmpty(id), but it should be StringUtils.isNullOrEmpty(id).

 

Cheers,
Andrej

Outcomes