How to send XMPP Message with a given From or ReplyTo?
I would like to initiate a Chat between two users A and B from my web application. So I create an XMPP Message using Smack Client A开发者_C百科PI or directly from an OpenFire Plugin:
- Send a Message by Smack from A to B
- Send a Message by Smack from Server to B with replyTo A
XEP-0033 allow "replyTo address" supported by OpenFire but not suported by IM Clients.
It seems "from" can't be overrided by a client or an OpenFire plugin. I also think GTalk will not accept an xmpp message from userA@gmail.com to userB@gmail.com by ServerToServer protocol.
Is there an other way to do this ? I want my web application to forge a message from UserA to UserB. But this webapp is not A or B.
Best Regards, Jp
Any XMPP server should ignore the from address in a stanza and stamp the one that it get's from the connection into the stanza it sends on. This is a specific feature of XMPP compliant servers and is used to stop address spoofing and spam etc. You'd probably have to edit the source of a server and change it's behaviour. This is dangerous though and I wouldn't reccomend it if you'll be federating with other servers.
J
精彩评论