mrDoctorWho / ejabberd_mod_apns

An ejabberd module to send PUSH messages to iOS devices through APNS
MIT License
33 stars 19 forks source link

Blocked users should not be received notification using mod_apns.erl in ejabberd #25

Open nileshbacancy opened 6 years ago

nileshbacancy commented 6 years ago

Hello @mrDoctorWho @zinid I am using ejabberd 16.09 version, for notification use mod_apns.erl file to the mod_apns module.

I am receiving offline message using this module and also for getting notification from blocked users message. i.e. UserA and UserB online. UserA has blocked to UserB. UserA can't send a message but when UserB sends message UserA getting that sent message in the notification.

So, Can you please help me out for how to prevent the notification from blocked users?

mrDoctorWho commented 6 years ago

Hi @nileshbacancy

What type of blocking your users use?

nileshbacancy commented 6 years ago

Hello @mrDoctorWho let me take one example: UserA open chat app and he has UserB in chat contact list. UserA has a block to UserB (Block contact feature). When UserB sends any message at that time UserA received that message notification. I have used mod_apns.erl file for sending notification in IOS.

mrDoctorWho commented 6 years ago

@nileshbacancy There are few ways to block a user.

  1. The user can be blocked via XEP-0016: Privacy Lists
  2. The user can be blocked via XEP-0191: Blocking Comamnd
  3. The user can be blocked internally, by the client (library)

Too find out what check I should perform before sending a PUSH, I need to know what type of blocking you use.

nileshbacancy commented 6 years ago

Hello @mrDoctorWho

We are using 2. point to blocking command in IOS. 2. The user can be blocked via XEP-0191: Blocking Command

I just want to prevent PUSH notification while Blocked user sends any message to that user which has blocked to him. Please read my previous comment example.

Can you please tell me which script run in mod_apns.erl for sending a PUSH in IOS?