mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-22 20:47:57 +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) {
|
||||
final IQ iq = (IQ) packet;
|
||||
if (iq.isRequestIQ()) {
|
||||
final IQ iqRequest = iq;
|
||||
final String key = XmppStringUtils.generateKey(iq.getChildElementName(), iq.getChildElementNamespace());
|
||||
IQRequestHandler iqRequestHandler;
|
||||
final IQ.Type type = iq.getType();
|
||||
|
@ -1162,6 +1163,11 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
|||
// e.g. to avoid presence leaks.
|
||||
return;
|
||||
}
|
||||
|
||||
assert (response.getType() == IQ.Type.result || response.getType() == IQ.Type.error);
|
||||
|
||||
response.setTo(iqRequest.getFrom());
|
||||
response.setStanzaId(iqRequest.getStanzaId());
|
||||
try {
|
||||
sendStanza(response);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue