Roster Management

中秋 李
Added over 2 years ago


Thank you for your time. I want to make A and B to be friends(subs=both in tig_pairs) when tigase receiving a message from C. I think I could modify A and B's rosters in db directly and then notify them. But how could I get A'roster in a class (implements XMPPProcessorIfc)'s process? Or anything help will be appriciated.

Replies (7)

Added by 中秋 李 over 2 years ago

Well, I found you mentioned in this topic(, using tigase.xmpp.impl.Presence.getRosterUtil(). We could only get the session owner's roster. How about others' roster? Thanks.

Added by Wojciech Kapcia TigaseTeam over 2 years ago

This is intentional and limitation of plugin API - from one user session it's not possible to access other user data. What is exactly the use case here? Why do you want to control subscription with unrelated JID (user C)? Maybe there is other way to achieve your end result?

Added by 中秋 李 over 2 years ago

Glad to receive your reply.

Oh, it's bad news. The case is B is a machine which has an xmpp account, C is B's administrator, and C wants to share B to A. So that A can also contact with B. You know, as a machine like B, it's complicated for it to go through the process of subscription in xmpp.

There is another way after searching the topics. Maybe i could use admin ad-hoc command to sync the modification between in cache and db. Is it possible?

Or other ways in your opinion?

Thanks very much.

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 2 years ago

If you already consider usage of adhoc commands, you should look at user-roster-management adhoc command which is part of Tigase XMPP Server. It allows Tigase XMPP Server administrators to modify rosters of other users of a server.

Another solution is to connect XMPP client to the same JID which is used in "machine" (you can connect many clients using same BareJID) and process with roster manipulation in this XMPP client - this way roster for XMPP connection from "machine" will be updated as well.

Added by 中秋 李 over 2 years ago

Thank you for your help.

The second solution may not be appropriate for me.

As far as I know, adhoc commands can be use in two cases:

  1. Invoked over HTTP REST API. Usually for web client;

  2. Accessed via XMPP connection;

Which applies to a plguin in Tigase XMPP Server? Would you please show me the documents about it? Having not found the exact official information.

Thanks again. Best regards.

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 2 years ago

AdHoc commands of Tigase XMPP Server can be executed from XMPP or HTTP REST API. They are accessible using both ways, however for use of HTTP REST API you need HTTP API component configured.

As for calling using HTTP REST API you will find documentation on calling AdHoc commands in HTTP API project wiki pages.

Added by 中秋 李 about 2 years ago

Resolved it perfectly. It's so convenient. Thank you all for providing the server and the timely help.