Allow loading some network modules as user or global modules. #346

Open
opened 2026-10-05 04:14:25 +02:00 by adam · 3 comments
Owner

Some network modules which I list should be loadable as user or network
modules. This list might not contain everything, these are only the ones
that I noticed while browsing in webadmin. I am on
ZNC 1.5-git-149-64fb99a so some of these might already be fixed.

  • autocycle
    • If the only person on channel isn't op with Services, ChanServ joins
      and stays the channel until they leave or someone else comes too.
      (at least at freenode)
  • awaynick
    • I hate this module and I am not going to give any explanations! Move
      to simple_away.
  • keepnick
    • Usually registered nickname is configured as primary nickname and I
      am personally loading this on all networks and I think that many other
      people are doing the same.
    • This probably wouldn't hurt to have as global module either.
  • kickrejoin
    • As far as I know, most of people are loading this module on every
      network anyway so why to not allow it to be loaded as user module or
      global module?
      • To make it more difficult for people as this module shouldn't be
        used?
  • modules_online
    • If I understood correctly, this module is meant for IRC clients
      which check that nickname is online before sending messages. I am
      loading this on every network and I have script in WeeChat to
      autowhois on query. I think that this should be user module and why
      not global module?
  • route_replies
    • Some IRC clients behave weirdly when they receive replies that they
      didn't send and I am loading this elsewhere so in my opinion this
      should also be user and global module.
  • simple_away
    • Setting automatic /away is a lot better behaviour than automatic
      away nick and as far as I know, this module doesn't change away
      messages set by user so why to not have it as user or global module?
      This is another of those modules which I load everywhere.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2759219-allow-loading-some-network-modules-as-user-or-global-modules?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github).
Some network modules which I list should be loadable as user or network modules. This list might not contain everything, these are only the ones that I noticed while browsing in webadmin. I am on `ZNC 1.5-git-149-64fb99a` so some of these might already be fixed. - autocycle - If the only person on channel isn't op with Services, ChanServ joins and stays the channel until they leave or someone else comes too. (at least at freenode) - awaynick - I hate this module and I am not going to give any explanations! Move to simple_away. - keepnick - Usually registered nickname is configured as primary nickname and I am personally loading this on all networks and I think that many other people are doing the same. - This probably wouldn't hurt to have as global module either. - kickrejoin - As far as I know, most of people are loading this module on every network anyway so why to not allow it to be loaded as user module or global module? - To make it more difficult for people as this module shouldn't be used? - modules_online - If I understood correctly, this module is meant for IRC clients which check that nickname is online before sending messages. I am loading this on every network and I have script in WeeChat to autowhois on query. I think that this should be user module and why not global module? - route_replies - Some IRC clients behave weirdly when they receive replies that they didn't send and I am loading this elsewhere so in my opinion this should also be user and global module. - simple_away - Setting automatic /away is a lot better behaviour than automatic away nick and as far as I know, this module doesn't change away messages set by user so why to not have it as user or global module? This is another of those modules which I load everywhere. ## <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2759219-allow-loading-some-network-modules-as-user-or-global-modules?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:36219798 -->
Author
Owner

General reason why some arbitrary network module is not global, is that they need to maintain some state. That state is simply stored in this, which is different for different networks, when the module is loaded as network module. If the module becomes global (or user) module, it has only shared state, because it's only one module instance for every network (and sometimes it's actually the desired behavior). Or the module needs to maintain multiple per-network states itself.
So, some network modules which don't have any state, may become user or global modules easily; other might require more effort.
P.S. Note that the "state" might include both internal stuff, and various configuration parameters.

General reason why some arbitrary network module is not global, is that they need to maintain some state. That state is simply stored in `this`, which is different for different networks, when the module is loaded as network module. If the module becomes global (or user) module, it has only shared state, because it's only one module instance for every network (and sometimes it's actually the desired behavior). Or the module needs to maintain multiple per-network states itself. So, some network modules which don't have any state, may become user or global modules easily; other might require more effort. P.S. Note that the "state" might include both internal stuff, and various configuration parameters. <!-- github-comment-id:46767027 -->
Author
Owner

I would personally love some sort of /znc massload command that loads an instance of a network module for all networks configured, and possibly setting defaults for those plugins too (e.g. *route_replies silent yes).

Also, I think being able to load these plugins on the user level should be enough; loading them globally might be too much since individual users should be able to manage the modules they want for themselves.

I would personally love some sort of `/znc massload` command that loads an instance of a network module for all networks configured, and possibly setting defaults for those plugins too (e.g. `*route_replies silent yes`). Also, I think being able to load these plugins on the user level should be enough; loading them globally might be too much since individual users should be able to manage the modules they want for themselves. <!-- github-comment-id:51570124 -->
Author
Owner
  • autoop
  • autovoice

This would be helpful with multiple networks as I have same hostmasks *!mkaysi@kapsi.fi and `!mkaysi@.kapsi.fi`` everywhere and would like to autoop them.

- autoop - autovoice This would be helpful with multiple networks as I have same hostmasks `*!mkaysi@kapsi.fi` and `*!mkaysi@*.kapsi.fi`` everywhere and would like to autoop them. <!-- github-comment-id:56336334 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#346