[jdev] _c2s_client_sx_callback
Matthias Wimmer
m at tthias.net
Thu Jun 10 06:55:02 CDT 2004
Hi Remy!
Remy HAREL schrieb am 2004-06-10 12:20:45:
> I'm working in c2s component. Now, I'm able to know the recipient of
> a packet now ( thanks to Mathias Wimmer ;) ) but sometimes, when the
> recipient is me, I'd like to know the full jabber id which has sent it
> to me . So I use the same method for the two functions calls :
>
> attr1 = nad_find_attr(nad, 0, -1, "from", NULL);
> attr = nad_find_attr(nad, 0, -1, "to", NULL);
>
> The second works fine, but the first one returns -1, so it failed. Why
> I can't do that please ?
Because you should not do this in c2s ... I already warned you some time
ago.
Jabber clients normally don't sent a from attribute (and if they do, the
to attribute is overwritten by the server anyway). The incoming stanzas
where you are looking for the from attribute just don't have such an
attribute.
(The attribute is added by the session manager (sm) ... they never get a
from attribute in c2s.)
Tot kijk
Matthias
--
Fon: +49-(0)70 0770 07770 http://matthias.wimmer.name/
HAM: DB1MW xmpp:mawis at amessage.info
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://www.jabber.org/jdev/attachments/20040610/2f199442/attachment-0002.pgp>
More information about the JDev
mailing list