mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-21 22:02:06 +01:00
Fix Stanza.overrideExtension(ExtensionElement)
Also fixes SMACK-818.
This commit is contained in:
parent
458d8d98b6
commit
0e31bc8f73
1 changed files with 4 additions and 1 deletions
|
@ -394,7 +394,10 @@ public abstract class Stanza implements TopLevelStreamElement {
|
|||
public ExtensionElement overrideExtension(ExtensionElement extension) {
|
||||
if (extension == null) return null;
|
||||
synchronized (packetExtensions) {
|
||||
ExtensionElement removedExtension = removeExtension(extension);
|
||||
// Note that we need to use removeExtension(String, String) here. If would use
|
||||
// removeExtension(ExtensionElement) then we would remove based on the equality of ExtensionElement, which
|
||||
// is not what we want in this case.
|
||||
ExtensionElement removedExtension = removeExtension(extension.getElementName(), extension.getNamespace());
|
||||
addExtension(extension);
|
||||
return removedExtension;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue