How to allow Ejabberd external XMPP component to send presence packets on behalf of a user -


i wrote external component ejabberd, when trying send presence stanzas on behalf of user 400 error.

the component's name bot.domain.com , host name in ejabberd domain.com , have set "check_from" flag false component.

below example of presence stanza trying send component on behalf of user:

<presence from="user@domain.com">     <status>test status</status>     <show>dnd</show> </presence> 

and error message returned ejabberd:

<presence type="error" to="user@domain.com">     <status>test status</status>     <show>dnd</show>     <error code="400" type="modify">          <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>     </error> </presence> 

if add to="user2@domain.com" in package i'm sending, destination user receives package.

if add to="domain.com", don't 400 error anymore, presence not broadcast in user's roster.

the actual problem seems ejabberd not broadcasting presence packet in user's roster.

any ideas might missing or why 400 error when not specifying "to" field?

you cannot broadcast roster presence on behalf of user component. component service not load user roster. ejabberd_c2s taking care of loading roster broadcast presence. takes care of checking privacy list , many important features of xmpp.

as side note, not know expect approach, can split presence user session in xmpp. user online first because has session open on xmpp , secondarily because sent presence. faking presence sending component users, not guaranteed that user have session opened. in case, overall behaviour not 1 expect.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -