How can the recipient be informed that someone has blocked them on ejabberd?

111 Views Asked by At

We are building a chat app using latest ejabberd and there is a use case where user A blocks user B. the requirement is to hide last seen or user's presence from each other. if A blocks B then its easy to hide these information from user A but how can user B be informed that user A has blocked them ? whats the best approach to tell user B the someone has blocked them on realtime while both are in a conversation , like whatsapp does now.

2

There are 2 best solutions below

0
Mickaël Rémond On

For presence, you do not have to use block, you can simply remove contacts from roster. That way, the other user is notified and can also stop sharing his presence.

0
Kenan Begić On

There is XEP-0191: Simple Communications Blocking:

https://xmpp.org/extensions/xep-0191.html

https://xmpp.org/extensions/attic/xep-0191-0.2.html

I think it will give you the answers you need. Now it depends how will you implement this functionality using chosen client library like Smack.