简体   繁体   中英

How to restrict users to send and receive messages within rosteritem in ejabberd?

I have created users in ejabberd server using REST API. Using send_message API, I could send messages directly to any user using their jabberd id.

But I need to restrict the users to send/receive messages only with their roster items.

For example,

There is two users, user1@localhost and user2@localhost

Now the user2 is not the roster item of user1 . Here, the user2 should be restricted to send direct messages to user1 .

Only after adding user2 to the roster item of user1 , the user2 could send messages to user1 and it should be handles in the backed .

Is there any ejabberd modules to do it or is there any other ways to do it?

Take a look at mod_block_strangers :

This module allows to block/log messages coming from an unknown entity. If a writing entity is not in your roster, you can let this module drop and/or log the message.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM