1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 18:59:41 +02:00

Add getLastStanzaReceived() to XMPPConnection

also remove faulty PongFilter from PingManager. It never matched any
stanzas, since a Pong is just a plain result IQ that is not qualified by
any XMPP Ping namespace.

Fixes SMACK-597
This commit is contained in:
Florian Schmaus 2014-08-20 10:33:52 +02:00
parent f65c0d5528
commit 64e49cb934
5 changed files with 22 additions and 25 deletions

View file

@ -1136,4 +1136,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
PacketFilter replyFilter = new IQReplyFilter(iqRequest, this);
sendStanzaWithResponseCallback(iqRequest, replyFilter, callback, exceptionCallback, timeout);
}
private long lastStanzaReceived;
public long getLastStanzaReceived() {
return lastStanzaReceived;
}
protected void reportStanzaReceived() {
this.lastStanzaReceived = System.currentTimeMillis();
}
}

View file

@ -457,4 +457,11 @@ public interface XMPPConnection {
public void sendIqWithResponseCallback(IQ iqRequest, final PacketListener callback,
final ExceptionCallback exceptionCallback, long timeout)
throws NotConnectedException;
/**
* Returns the timestamp in milliseconds when the last stanza was received.
*
* @return the timestamp in milliseconds
*/
public long getLastStanzaReceived();
}