How to block anonymous user in XMPP
Asked Answered
F

3

7

In order to implement chat functionality in my app, I have integrated XMPP framework in to it. There is no buddy request functionality hence users can send messages to other users without sending a buddy request. Due to this functionality I have not created any Roster or Privacy list in the app, and anonymous chat mode has been implemented.

Everything works fine except block user functionality, since this is an anonymous user chat hence there is no privacy list for the users, and XMPP extension XEP-016 only supports blocking through privacy list.

I have also tried to look for the alternatives and one of them is to implement XEP-0191 but unfortunately Open Fire does not supports this extension.

So techies please guide me to fix this problem. Following are my questions.

  1. Do I need to create a privacy list/roster to block a user in anonymous user chat mode. This solution looks impractical since my app may have thousands of users.

  2. Shall I Change the Jabber server from open fire to EJabber? Does Ejabber support XEP-0191

Apart from above please let me know if you guys know any other workaround to block/unblock a user in anonymous user chat mode in Jabber.

Fallonfallout answered 5/5, 2013 at 8:13 Comment(0)
F
0

Unfortunately I have to stick with Open fire server. In order to fix the block user problem I had to go through the documentation of XMPP and finally found the solution in XEP-0016, this extension indeed has the capability to support the anonymous user blocking. To accomplish this one has to create a privacy list on server using - (void)setListWithName:(NSString *)privacyListName items:(NSArray *)items fromUser:(NSString *)user;method. Once done mark the created list as Active list by calling the method - (void)setActiveListName:(NSString *)privacyListName;.

XEP-0016 has nothing to do with Roster and it can block anonymous user chat.

Fallonfallout answered 21/5, 2013 at 16:58 Comment(3)
I have doing similar app as yours and I am not able to block anonymous user. Can you please share how exactly you achieved this functionality. I am using xmpp with ejabber server.Damiondamita
@Damiondamita you would need to maintain a privacy list of blocked users on jabber server. Each time a user is blocked/unblocked you would need to make changes in that privacy list. Please refer XEP-0016 for more information.Fallonfallout
@sandy, @ Sunil_Vaishnav I want to simple block and unblock user in XMPP Please find below link for more information. https://mcmap.net/q/1628113/-how-can-i-block-user-xmpp-in-swift-3/2910061 Thanks.Vagarious
I
1

I have no experience with EJabber server, but XEP 0191 is definitely the protocol you need.

You may have a look here http://www.ejabberd.im/protocols and see, that EJabber supports your protocol.

My advice will be to change the server.

Impecunious answered 15/5, 2013 at 14:53 Comment(0)
Q
1

A block is moot anyway. If you block a person they could just create a new anonymous user and start contacting you again. Whilst this might seem like a lot of effort it could easily be scripted to send spam messages. Every 30mins you create a new account and spam everybody, get kicked and repeat.

At the very least you are going to have to implement XEP-0191 (server side block list) and figure out how to deal with anonymous new accounts.

Quinonoid answered 16/5, 2013 at 10:24 Comment(0)
F
0

Unfortunately I have to stick with Open fire server. In order to fix the block user problem I had to go through the documentation of XMPP and finally found the solution in XEP-0016, this extension indeed has the capability to support the anonymous user blocking. To accomplish this one has to create a privacy list on server using - (void)setListWithName:(NSString *)privacyListName items:(NSArray *)items fromUser:(NSString *)user;method. Once done mark the created list as Active list by calling the method - (void)setActiveListName:(NSString *)privacyListName;.

XEP-0016 has nothing to do with Roster and it can block anonymous user chat.

Fallonfallout answered 21/5, 2013 at 16:58 Comment(3)
I have doing similar app as yours and I am not able to block anonymous user. Can you please share how exactly you achieved this functionality. I am using xmpp with ejabber server.Damiondamita
@Damiondamita you would need to maintain a privacy list of blocked users on jabber server. Each time a user is blocked/unblocked you would need to make changes in that privacy list. Please refer XEP-0016 for more information.Fallonfallout
@sandy, @ Sunil_Vaishnav I want to simple block and unblock user in XMPP Please find below link for more information. https://mcmap.net/q/1628113/-how-can-i-block-user-xmpp-in-swift-3/2910061 Thanks.Vagarious

© 2022 - 2024 — McMap. All rights reserved.