开发者

Ejabberd Packet Filtering

I am trying to build an online chat application on top of ejabberd, I am using extauth and everything was working fine till now. Now I am facing a problem in sending a message from A user who is not in B's roster (some sort of moderator or stuff), but ejabberd is blocking the message because both users are not connected, I have looked into shared roster feature of E开发者_Python百科jabberd but it doesn't work with Extauth, I have also tried to filter packet (if packet is from moderator than simply forward it else do routine processing), but it wasn't successful (Don't know how to forward the packet and stop the execution of hooks).

Please help me how can I achieve this functionality.

Thanks


why not subscribe users to each other (by sending subscribe-subscribed sequence) - it may be temporary only. By subscribing users you will create entries in roster table, which will allow packet delivery. Also, depending on architecture of your chat app maybe try mod_muc?

good reference to all dataflows: http://xmpp.org/


Old forum though, adding the response to help and learn. In order to bypass the hooks and forward the message , probably following steps might help

  • Add the hook for 'filter_packet' with more priority
  • In that do your validations
  • forward this by calling on 'run' on other hook which you are looking for
  • drop the package at that point( as other hook on which 'run' is called will take care)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜