mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12:05 +01:00
Ensure that IQ response 'to' address and ID are set correctly
Fixes SMACK-845.
This commit is contained in:
parent
5ddaa623da
commit
f6da386dea
1 changed files with 6 additions and 0 deletions
|
@ -1097,6 +1097,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
if (packet instanceof IQ) {
|
if (packet instanceof IQ) {
|
||||||
final IQ iq = (IQ) packet;
|
final IQ iq = (IQ) packet;
|
||||||
if (iq.isRequestIQ()) {
|
if (iq.isRequestIQ()) {
|
||||||
|
final IQ iqRequest = iq;
|
||||||
final String key = XmppStringUtils.generateKey(iq.getChildElementName(), iq.getChildElementNamespace());
|
final String key = XmppStringUtils.generateKey(iq.getChildElementName(), iq.getChildElementNamespace());
|
||||||
IQRequestHandler iqRequestHandler;
|
IQRequestHandler iqRequestHandler;
|
||||||
final IQ.Type type = iq.getType();
|
final IQ.Type type = iq.getType();
|
||||||
|
@ -1162,6 +1163,11 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
// e.g. to avoid presence leaks.
|
// e.g. to avoid presence leaks.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert (response.getType() == IQ.Type.result || response.getType() == IQ.Type.error);
|
||||||
|
|
||||||
|
response.setTo(iqRequest.getFrom());
|
||||||
|
response.setStanzaId(iqRequest.getStanzaId());
|
||||||
try {
|
try {
|
||||||
sendStanza(response);
|
sendStanza(response);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue