AnsweredAssumed Answered

Force "From" attribute in outgoing stanzas

Question asked by Amitoj on Jul 27, 2016
Latest reply on Jul 28, 2016 by Flow


It seems like Smack removes 'from' attribute from all outgoing stanzas as per this issue .


Generally this behavior works fine, but I'm trying to implement a proposed extension ( ) . Apparently ejabberd expects 'from' attribute in custom-iq stanza to function properly. Is there a way to force "from" attribute into a particular packet.


Here is my code:

public class MucSubIq extends IQ {...}
final MucSubIq mucSubIq = new MucSubIq(this.nick);
Log.i(TAG,mucSubIq.toXML().toString());  //Prints: <iq to='' from='' id='M630P-12' type='set'>...</iq>
connection.sendStanza(mucSubIq); //Debug Output: SENT (0): <iq to='' id='M630P-12' type='set'>...</iq>