Project

General

Profile

Adding support for XEP-0055

Prashanth Raghu
Added almost 4 years ago

Hi,

I was trying to add support for XEP-0055 by adding a plugin to Tigase.

I have implemented a basic class which responds to iq packet requests of the query type.

I have also configured my init.properties to load the plugin which is happening successfully.

When I fire a request of type:

@

<iq type='get'

from='admin@localhost'

to='localhost'

id='search1'

xml:lang='en'>

@

I get a response:

@

<iq xmlns='jabber:client'

from='localhost'

to='admin@localhost'

type='error'

id='search1'>

<error code='501'

   type='cancel'>

<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'

  xml:lang='en'>

Feature not supported yet.

@

Can I know what remains to be done to support the addition of the plugin?

Should I implement this as a component ?

Regards,

Prashanth


Replies (7)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam almost 4 years ago

Your plugin code should also contain following methods:

@Override
public String[][] supElementNamePaths() {
    return ELEMENTS;
}

@Override
public String[] supNamespaces() {
    return XMLNSS;
}

These methods are responsible for telling the Tigase what kind of stanzas the plugin intercepts. Please take a look at Message.java plugin for exact code examples.

Added by Prashanth Raghu almost 4 years ago

Thanks Artur. It works just perfect now.

Can I also know if the community is interested to have the XEP-0055 support for tigase ?

I can then start working on the full implementation of the specification.

Added by Ganesh Krishnan over 3 years ago

Hi Prashanth,

I am looking forward to support of XEP-0055 on tigase server. I am surprised this doesn't exist yet. Can you please let me know if you plan on creating a plugin to support it?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 3 years ago

The XEP is not supported and we are hesitant to add it, because it generates lots of security and privacy issues. Even though the XEP is implemented on some other XMPP Servers, it is almost never activated on any public service running on these servers.

I understand that it might be useful and desired on some deployments, but, to be honest it has never been demanded before.

Added by Ganesh Krishnan over 3 years ago

So whats the ideal way to find out if my phone contact is a registered user on the server?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 3 years ago

For a few reasons I do not think XEP-0055 is the best choice for the task. It would be too slow querying the server for each contact. A better approach is to upload all contacts to the server, then the server runs a query and returns results when they are ready.

We worked with a company which did a similar thing. The experience from this, is that it is generally quite slow and takes long time to return results. Especially if you have thousands or millions users and each has hundreds contacts on their phone. So what they did, was, each user (a mobile client) submitted user's contacts to the server and server created a long queue for the contact's search in the DB. For a large number of users, getting results may take a few days. Any optimizations you can make for the DB query are very dependent on the DB engine you use.

Added by Ganesh Krishnan over 3 years ago

Which makes me wonder what does a company like whatsapp do? I assume they only do this once on program registration and on contact page refresh. But it's pretty crazy if the results take few days to return.

    (1-7/7)