Quantcast
Channel: Ignite Realtime : Unanswered Discussions - Support
Viewing all articles
Browse latest Browse all 4979

Force "From" attribute in outgoing stanzas

$
0
0

Hi,

It seems like Smack removes 'from' attribute from all outgoing stanzas as per this issue https://issues.igniterealtime.org/browse/SMACK-547 .

 

Generally this behavior works fine, but I'm trying to implement a proposed extension ( https://docs.ejabberd.im/developer/proposed-extensions/muc-sub/ ) . 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);
mucSubIq.setFrom(myXmppId);
mucSubIq.setTo(groupName);
mucSubIq.setType(IQ.Type.set);
Log.i(TAG,mucSubIq.toXML().toString());  //Prints: <iq to='temproom@conference.gappi.in' from='9739937980@gappi.in' id='M630P-12' type='set'>...</iq>
connection.sendStanza(mucSubIq); //Debug Output: SENT (0): <iq to='temproom@conference.gappi.in' id='M630P-12' type='set'>...</iq>

Viewing all articles
Browse latest Browse all 4979

Trending Articles