Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: ns update question  (Read 8143 times)

0 Members and 1 Guest are viewing this topic.

katsklaw

  • Supporter
  • Anope User
  • Offline Offline
  • Posts: 537
ns update question
« on: September 01, 2011, 08:19:59 PM »

What is the reason that ns update does not emit EVENT_NICK_IDENTIFY?? I mean ns update is a sync tool is it not?
Logged

Jobe

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1023
    • Anope IRC Services
Re: ns update question
« Reply #1 on: September 01, 2011, 10:46:14 PM »

EVENT_NICK_IDENTIFY means the user identified to his/her nick. Where ns update only updates channel modes relating to the users access and requires the user has ALREADY identified. So for this reason ns update is NOT the same as ns identify.
Logged
Your IP: ()
My IRC Status:

Come along and visit http://www.anopequotes.org/

katsklaw

  • Supporter
  • Anope User
  • Offline Offline
  • Posts: 537
Re: ns update question
« Reply #2 on: September 01, 2011, 10:59:40 PM »

no, ns update does more than just update channel modes, it also does flags, memos, vhost as well as chmodes. So it basiclly resyncs everything else. There is no harm in sending EVENT_NICK_IDENTIFY as well so 3rd party modules can hook ns update as well.

What triggered the question is I'm workning on a db driven UmodeOnID system that allows ServicesAdmins to set usermode that are given upon ID. It would be helpful for that to be resynced during ns update just like NSModeOnID is. I'm sure there are other things that could benefit as well.
« Last Edit: September 01, 2011, 11:15:00 PM by katsklaw »
Logged

Jobe

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1023
    • Anope IRC Services
Re: ns update question
« Reply #3 on: September 02, 2011, 09:41:02 AM »

To be honest I disagree with firing EVENT_NICK_IDENTIFY on ns update. It would be far better (and safer for existing modules) if a new event were created.
Logged
Your IP: ()
My IRC Status:

Come along and visit http://www.anopequotes.org/

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 463
Re: ns update question
« Reply #4 on: September 02, 2011, 09:43:40 AM »

An event for /ns update does exist and has existed since very early 1.9 development.. and no we don't change 1.8s behaviour and modules expect certain events to be called at certain times and not others.
Logged

Jens Voss

  • Team
  • *
  • Offline Offline
  • Posts: 125
Re: ns update question
« Reply #5 on: September 02, 2011, 12:49:07 PM »

in 1.8 you can bind to the identify and update command with MOD_TAIL to execute your code.

example:

Code: [Select]

#include "module.h"

int do_on_identify(User *u)
{

    /* stop if nick is not identified */
    if (!nick_identified(u))
    {
          return MOD_CONT;
    }

   
    /* this is a good place */
    /* to add your code     */

    return MOD_CONT;
}


int AnopeInit(int argc, char **argv)
{
   Command *c;   

   c = createCommand("IDENTIFY", do_on_identify, NULL, -1, -1, -1, -1, -1);
       moduleAddCommand(NICKSERV, c, MOD_TAIL);
   c = createCommand("ID", do_on_identify, NULL, -1, -1, -1, -1, -1);
       moduleAddCommand(NICKSERV, c, MOD_TAIL);
   c = createCommand("UPDATE", do_on_identify, NULL, -1, -1, -1, -1, -1);
       moduleAddCommand(NICKSERV, c, MOD_TAIL);

  return MOD_CONT;
}

Because we have already a working solution I dont see any reason to add an additional event to the update command.
Logged

katsklaw

  • Supporter
  • Anope User
  • Offline Offline
  • Posts: 537
Re: ns update question
« Reply #6 on: September 02, 2011, 02:23:21 PM »

None of that actually answered my question.

Perhaps its time for me to just fork 1.8 and skip all the red tape.

thanks.
Logged

culex

  • Anope User
  • Offline Offline
  • Posts: 4
Re: ns update question
« Reply #7 on: September 02, 2011, 02:33:24 PM »

Perhaps its time for me to just fork 1.8 and skip all the red tape.

Yes, please. If you think you can do better than the Anope team, please do.
Logged

katsklaw

  • Supporter
  • Anope User
  • Offline Offline
  • Posts: 537
Re: ns update question
« Reply #8 on: September 02, 2011, 06:04:34 PM »

Yes, please. If you think you can do better than the Anope team, please do.

Lol! Actually "fork" is the wrong term. What I meant is i'll just edit the source to my needs and not worry about it. It will also save me from creating the module and just make the changes to the core directly.

No, my statement wasn't a claim of being able to do better nor will my modified version be available to the public.
« Last Edit: September 02, 2011, 06:07:27 PM by katsklaw »
Logged
Pages: [1]   Go Up