powered by Jive Software

Can there be a StanzaBuilder.removeExtension()?

As far as I can tell, there’s no StanzaBuilder.removeExtension() method, parallel to the addExtension() or overrideExtension() methods.

I’m trying to convert code in Jitsi’s jicofo to the immutable-stanza model. Right now, it keeps track of the presence to be sent by remembering the last Presence stanza sent, and modifying it and re-sending it with a new stanzaId when something changes.

Obviously using a PresenceBuilder would be best for the new model, using something like xmppConnection.getStanzaFactory().buildPresenceStanzaFrom(lastPresence), but in cases where the existing code removes an extension from the presence stanza, I’d need to remove it from the builder instead.

As far as I can tell there’s no API to do that - can one be added?

(I’m looking at Smack 4.4.3 if that matters.)

Yes, definitely. Thanks for the feedback. It is probably an easy change. Pull requests welcome. Otherwise I’ll look next week into it.

I have a PR at https://github.com/igniterealtime/Smack/pull/504.

(Unfortunately I had to write this blindly, because I still can’t get Smack to build for me, but it seemed pretty obvious.)