mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 01:29:38 +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:
parent
f65c0d5528
commit
64e49cb934
5 changed files with 22 additions and 25 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue