Update the user's rosters directly at the tigase database. Issue, when jabber client at this moment is online.
I add/update/delete user's rosters directly at the tigase database to improve performance. I have stored procedure for this.
At the table tig_pairs i add/update/delete the section: **.
For example, i have 2 users: u1 and u2.
I add to tig_pairs:
It works for me, if jabber client of each user is offline. I use Psi, as client.
But i noticed, that if jabber client of, says, u1 is online and i run my procedure:
database updated (records is added to tig_pairs table), but jabber client of u1 is not updated.
as result when i offline the client of u1*, the record at the *tig_pairs table for u1 is overwritten by the empty value.
It happens, because after changing of the database, i don't update jabber client, so when i offline it, client writes to databse its previous roster value. And it is empty.
I checked the same through Ad-Hoc command ("user-roster-management-ext", as this https://repository.tigase.org/reps/tigase-testsuite/trunk/tests/data/AdHocRosterAddBoth.cot).
And i see that in this case server adds records to tig_pairs table, and after this!!! it sends some command to client, and client itself updates its roster.
So if in this case i offline the u1 client, the record is overwritten too, but in this case it is correct, because before client updated it.
So, I need your help. Any ideas. How can i automaticaly update online jabber clients.
Maybe here's another solution for my task? Because Ad-Hoc command does not fit me. It is very slowly for my number of users. I need update roster for more then 200 user at the same time.
Added by Artur Hefczyc over 4 years ago
There are a few already, one of which is this ""user-roster-management-ext"" you mentioned about in your own post. There is probably none of the ad-hoc commands you can use out of the box but you can use them as a code example to implement your own. Most of the roster management commands deal with online users correctly and send notifications about roster change.
Added by Dmitry Anatolievich over 4 years ago
Thx for your reply.
I saw the existing ad-hoc commands (scripts). And i see, that they do push roster operation (through rosterUtil.updateBuddyChange() method).
And if i will use this approach, i will need execute push operation several times for one client.
Says, i have u1*, *u2 and u3 clients.
So, for u1 i will execute push operation twice (u2 jid and u3 jid); for u2 - twice too (u1 jid and u3 jid); for u3 - twice too (u1 jid and u2 jid).
And if I will have 200 users or more, it will run for a long time, i think. Maybe I'm wrong. Pls, correct me if so.
Do i have the possibilty to send from server (from my own ad-hoc script) to client one command, after that client updates its roster?
If you have some samples or codes, please show me.
Thx and best regards.