Project

General

Profile

Changing Mobile_v2 plugin

Keren Meir
Added over 5 years ago

Hi

I want to implement something in addition to mobile_v2 plugin:

When the client send the iq packet of mobile_v2 (enable=true), I want to start a timer. When the timer reaches X sec (pre-defined time) I want to implement something.

My question is: Where is the best place to implement it? in the plugin itself? or start a new thread in the plugin? or is there another place?

Thanks

Keren


Replies (5)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

As always, I suggest to create your own plugin. The less you modify Tigase original code the less you have work on each software update.

You can have many plugins working at the same time intercepting the same packet (mobile_v2 IQ stanza in this case).

One more remark, think twice or more before you implement something like that. The potential problem I in your idea is that it may kill your installation when you have 100k or more users connected to the server in the mobile_v2 mode. Then you would have to spawn 100k or more threads for 100k or more timers.

Added by Keren Meir over 5 years ago

  1. What is the difference between add my own plugin or change existing plugin?

  2. I tried to add another plugin with the same id (another mobile_v2 plugin) and I saw that only one works.

  3. What do you suggests to do? I want to know when a user is X minute in mobile mode...

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Keren Meir wrote:

  1. What is the difference between add my own plugin or change existing plugin?

I have explained this a few times already. The main thing is that you have to maintain your code long-term. Think about the work you will have to do on each Tigase upgrade. You will have to modify Tigase files in each new version.

  1. I tried to add another plugin with the same id (another mobile_v2 plugin) and I saw that only one works.

Each plugin must have a different ID. Select a different ID for your plugin.

  1. What do you suggests to do? I want to know when a user is X minute in mobile mode...

This really depends on many factors. Best solution depends on what you really need this for.

Added by Keren Meir over 5 years ago

Thanks!

I decided to create one thread who will take care for all the mobile_v2 users. Now I just have to figure out how to create this thread :) (Unless you'll help me with it ;) )

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Go to server development forums: https://projects.tigase.org/projects/tigase-server/boards/4# and post a new message.

    (1-5/5)