Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
Lilach #1
Member since Jun 2014 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: Pub-Sub - Subscribe - "From"
Hi,
I checked the Iq created by the method - pubSubManager.SubscribeStanza.
my code:
  1. iq = pubSubManager.SubscribeStanza(new Jid("pubsub.stg1.jabber2.mobli.com"), "/live/1601322", new Jid(jid));

and found out that the "From" attribute is not created.
this is what I get:

  1. <iq id="MX_2" to="pubsub.stg1.jabber2.mobli.com" type="set" xmlns="jabber:client">
  2.   <pubsub xmlns="http://jabber.org/protocol/pubsub">
  3.     <subscribe node="/live/1601322" jid="test28@stg1.jabber2.mobli.com" />
  4.   </pubsub>
  5. </iq>

Questions:
1. The Iq I get from this method is what eventually sent to the server ?
2. Why do "From" attribute is missing?
3. Can I build my own XML (iq) and send it using this SDK? if yes, how?
This post was edited on 2014-06-23, 13:59 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
1) right, MatriX is using this function internal in the PubSubManager to build and send the packets. We have made this function public on request of some customers who wanted to add additional XML to it and use it as a skeleton to extend.

2) the from attribute is never required when sending XMPP stanzas. And you should never add it.
When the server is routing your messages it stamps your message with the from automatically. In XMPP you cannot spoof the sender address for security reasons. When you send a stanza your are authenticated and your resource was assigned. The server exactly knows where the message is coming from, and adds the addressing for you.

3) Of course you can. MatriX is extremely extensible.
See here: http://www.ag-software.net/matrix-xmpp-sdk/matrix-develope…
This post was edited on 2014-06-23, 14:23 by Alex.
Avatar
Lilach #3
Member since Jun 2014 · 4 posts
Group memberships: Members
Show profile · Link to this post
Thanks Alex.
It's now working for me
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS