In ejabberd, I would like to intercept a subscribe request from one user to another, when the other user (to whom the request is being sent) is offline. Is there a specific hook I can use to catch this case? I just want to capture jid of of both )to/from) users and do something with it.
Asked
Active
Viewed 52 times
0
-
take a look at these hooks -roster_in_subscription,roster_get_subscription_lists,roster_out_subscription and resend_subscription_requests_hook. – Sunil Singh May 16 '16 at 07:36
-
Thanks. Do I need to use all of them? – Navjeet May 17 '16 at 23:22
-
you can use roster_in_subscription hook. – Sunil Singh May 18 '16 at 03:44
-
I did a quick test and looks like both roster_in and roster_out are triggered irrespective of whether the user is online or not. Is that expected behavior? Is there a way to find out at that point, if user is offline or not? – Navjeet May 18 '16 at 03:57
-
you can check using session user is online or not . – Sunil Singh May 18 '16 at 04:08