mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 02:27:58 +01:00
[core] Also provide incoming Nonzas to SmackDebugger
This commit is contained in:
parent
5844bee1c3
commit
b58511d624
1 changed files with 10 additions and 4 deletions
|
@ -1406,6 +1406,13 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
return successNonza;
|
return successNonza;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void maybeNotifyDebuggerAboutIncoming(TopLevelStreamElement incomingTopLevelStreamElement) {
|
||||||
|
final SmackDebugger debugger = this.debugger;
|
||||||
|
if (debugger != null) {
|
||||||
|
debugger.onIncomingStreamElement(incomingTopLevelStreamElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected final void parseAndProcessNonza(XmlPullParser parser) throws IOException, XmlPullParserException, SmackParsingException {
|
protected final void parseAndProcessNonza(XmlPullParser parser) throws IOException, XmlPullParserException, SmackParsingException {
|
||||||
ParserUtils.assertAtStartTag(parser);
|
ParserUtils.assertAtStartTag(parser);
|
||||||
|
|
||||||
|
@ -1434,6 +1441,8 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
|
|
||||||
Nonza nonza = nonzaProvider.parse(parser, incomingStreamXmlEnvironment);
|
Nonza nonza = nonzaProvider.parse(parser, incomingStreamXmlEnvironment);
|
||||||
|
|
||||||
|
maybeNotifyDebuggerAboutIncoming(nonza);
|
||||||
|
|
||||||
for (NonzaCallback nonzaCallback : nonzaCallbacks) {
|
for (NonzaCallback nonzaCallback : nonzaCallbacks) {
|
||||||
nonzaCallback.onNonzaReceived(nonza);
|
nonzaCallback.onNonzaReceived(nonza);
|
||||||
}
|
}
|
||||||
|
@ -1473,10 +1482,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
protected void processStanza(final Stanza stanza) throws InterruptedException {
|
protected void processStanza(final Stanza stanza) throws InterruptedException {
|
||||||
assert stanza != null;
|
assert stanza != null;
|
||||||
|
|
||||||
final SmackDebugger debugger = this.debugger;
|
maybeNotifyDebuggerAboutIncoming(stanza);
|
||||||
if (debugger != null) {
|
|
||||||
debugger.onIncomingStreamElement(stanza);
|
|
||||||
}
|
|
||||||
|
|
||||||
lastStanzaReceived = System.currentTimeMillis();
|
lastStanzaReceived = System.currentTimeMillis();
|
||||||
// Deliver the incoming packet to listeners.
|
// Deliver the incoming packet to listeners.
|
||||||
|
|
Loading…
Reference in a new issue