Check if a user with a JID exist

1,263 views
Skip to first unread message

aldilai...@yahoo.de

unread,
Aug 27, 2013, 1:59:31 PM8/27/13
to xmppfr...@googlegroups.com
Hey guys,

is it possible to use XMPPFramework to check if a User with a JID exists? 

Archit Agarwal

unread,
Aug 27, 2013, 2:06:25 PM8/27/13
to xmppfr...@googlegroups.com
If you try to register you get an error message with a conflict stanza. Look for in band registration xmpp protocol. 

You can use this to determine if a JID already registered. 

Sent from my iPhone

On 28 Aug, 2013, at 12:59 AM, aldilai...@yahoo.de wrote:

Hey guys,

is it possible to use XMPPFramework to check if a User with a JID exists? 

--
You received this message because you are subscribed to the Google Groups "XMPPFramework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xmppframewor...@googlegroups.com.
To post to this group, send email to xmppfr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xmppframework/73ae64de-5097-4447-b33b-5ba77bb5d4ab%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Spencer MacDonald

unread,
Aug 27, 2013, 2:28:57 PM8/27/13
to xmppfr...@googlegroups.com
What are you trying to achieve?

Regards

Spencer

On 27 Aug 2013, at 18:59, aldilai...@yahoo.de wrote:

Hey guys,

is it possible to use XMPPFramework to check if a User with a JID exists? 

aldilai...@yahoo.de

unread,
Aug 27, 2013, 2:36:09 PM8/27/13
to xmppfr...@googlegroups.com
Maybe I should mention that I m not a pro in XMPP. I m on a iOS app that allows to chat with your phone contacts. I m creating a self made roster and I want to save Contacts of my AB only if they exist already on my ejabberd server.

aldilai...@yahoo.de

unread,
Aug 27, 2013, 2:38:46 PM8/27/13
to xmppfr...@googlegroups.com
yea but if not the user is registered.. thats not so cool. On my server i can do using smack. But i would like to avoid another run over my user-server..

Spencer MacDonald

unread,
Aug 27, 2013, 2:50:26 PM8/27/13
to xmppfr...@googlegroups.com
How do you know the other person's JID?

I think if you attempt to subscribe to a jid that doesn't exist the server doesn't return an error otherwise you could use it for spamming people with messages.

Regards

Spencer

aldilai...@yahoo.de

unread,
Aug 27, 2013, 3:09:17 PM8/27/13
to xmppfr...@googlegroups.com

The JID is always the phonenumber so if one of my contacts is already registered I could check if he exist cuz i  gothis number..

aldilai...@yahoo.de

unread,
Aug 28, 2013, 10:31:53 AM8/28/13
to xmppfr...@googlegroups.com
noone has idea?

Archit Agarwal

unread,
Aug 28, 2013, 10:35:14 AM8/28/13
to xmppfr...@googlegroups.com
You can easily build a plugin for this. 
After logging in - send all the phone numbers/ids and on the server check if they exist or not by getting the whole user list and checking. 

Ideally would be good to hash the whole user list to keep it O(N) and not O(N^2)

Then you can return the status of the JID to the user. Seems quite straightforward. 

aldilai...@yahoo.de

unread,
Aug 28, 2013, 10:58:47 AM8/28/13
to xmppfr...@googlegroups.com
Would be great if you could help on that issue if you have experience in doing plugins.. I m new to XMPP and i not really have practice experience. I would appreciate that. Maybe we can have a chat about it?

Archit Agarwal

unread,
Aug 29, 2013, 5:31:16 AM8/29/13
to xmppfr...@googlegroups.com
Creating plugins is not very difficult. However it would take you a couple of hours to a day to get it right and make your first plugging working depending on your level of experience. 
I suggest reading the documentation of your server (Whichever server you are using - openfire is stable and popular). 

They have their own documentation to create a plugin. You can start with cloning an existing plugin and renaming it to your own plugging and doing something simple like printing a line. 
You can then go to read the documentation of openfire to implement a IQ packet router to intercept your custom IQ request. 

I suggest you take it slow and start with reading the documentation. It isn't as complex as it looks initially. 

ravi.d...@gmail.com

unread,
May 31, 2018, 8:22:06 AM5/31/18
to XMPPFramework
I'm stuck on the same issue. Did you find any solution to the problem?
Reply all
Reply to author
Forward
0 new messages