Project

General

Profile

Disable the ability to change a roster through jabber client.

Dmitry Anatolievich
Added over 4 years ago

Hello, everyone.

I need to disable the ability to change a roster through jabber client.

Can i do this? And how?

Thx.


Replies (6)

Added by Wojciech Kapcia TigaseTeam over 4 years ago

If you want to have users only a roster provided by server then using Dynamic Rosters would be best option;

As for preventing modification of regular (i.e. non-dynamic) roster then it's not possible out-of-the-box and would require extending JabberIqRoster plugin and overriding processSetRequest method with logic that prevents modification of the roster.

Added by Dmitry Anatolievich over 4 years ago

Hello, Wojciech.

Thx for your reply.

We implemented a java plugin for dynamic roster.

It works, but sometimes we noticed that some accounts (from dynamic roster!) are added to tig_pairs table!

Our dynamic roster uses custom stored procedure:

CREATE DEFINER=userdev@% PROCEDURE GetDynamicRosterList(

IN _pw_name varchar(64) CHARSET utf8,

IN _pw_domain varchar(64)  CHARSET utf8)

begin

SELECT distinct vm.pw_gecos as "_name", vm.pw_domain as "_group", 

CONCAT(vm.pw_name,'@',vm.pw_domain) as "_jid", "both" as "_subscription" 

FROM vpopmail.vpopmail vm

inner join tigase.tig_users tu on  tu.user_id = CONCAT(vm.pw_name,'@',vm.pw_domain)

where vm.pw_domain=_pw_domain and vm.pw_name <> _pw_name;

end

In other words: in dynamic roster there are some accounts, which we get from stored procedure.

But we can find the same accounts also in roster node in the table tig_pairs.

How can we avoid it?

Thx and best regards.

Added by Wojciech Kapcia TigaseTeam over 4 years ago

Dmitry Anatolievich wrote:

It works, but sometimes we noticed that some accounts (from dynamic roster!) are added to tig_pairs table!

Is there any pattern there (i.e. action performed before) that resulted in those entries in database? Would you be able to provide us logs from such events? Do you happen to attempt edition of the roster in any way (jabber:iq:roster, admin ad-hocs, etc) or those can be completely ruled out?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

This can happen when there is a subscription request exchanged between users. Then Tigase automatically creates an entry in the DB. However, the dynamic roster entries always override entries in the Tigase's own roster.

Added by Dmitry Anatolievich over 4 years ago

Hello, Artur.

In my case it seems like dynamic roster entries don't always override entries in the Tigase's own roster.

What do you suggest? Why it can happen?

Thx and best regards.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

Unfortunately I cannot answer the question. The correct, intended behavior is to overwrite standard roster by dynamic roster. If this does not work this way for you then it needs investigation.

    (1-6/6)