mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-22 18:14:48 +01:00
NickList: add priorities for event handlers
This ensures the irc.join, irc.quit, etc events get handled first or last as appropriate.
This commit is contained in:
parent
b970ee9aa6
commit
a503ce4ec0
@ -37,18 +37,18 @@ sub initialize {
|
|||||||
# TODO: track mode changes to update user flags
|
# TODO: track mode changes to update user flags
|
||||||
# Update: turns out that IRCHandler's on_mode() is doing this already -- we need to make that
|
# Update: turns out that IRCHandler's on_mode() is doing this already -- we need to make that
|
||||||
# emit a mode-change event or some such and register a handler for it here.
|
# emit a mode-change event or some such and register a handler for it here.
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('irc.namreply', sub { $self->on_namreply(@_) });
|
$self->{pbot}->{event_dispatcher}->register_handler('irc.namreply', sub { $self->on_namreply(@_) }, 0 );
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('irc.join', sub { $self->on_join(@_) });
|
$self->{pbot}->{event_dispatcher}->register_handler('irc.join', sub { $self->on_join(@_) }, 0 );
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('irc.part', sub { $self->on_part(@_) });
|
$self->{pbot}->{event_dispatcher}->register_handler('irc.part', sub { $self->on_part(@_) }, 100 );
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('irc.quit', sub { $self->on_quit(@_) });
|
$self->{pbot}->{event_dispatcher}->register_handler('irc.quit', sub { $self->on_quit(@_) }, 100 );
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('irc.kick', sub { $self->on_kick(@_) });
|
$self->{pbot}->{event_dispatcher}->register_handler('irc.kick', sub { $self->on_kick(@_) }, 100 );
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('irc.nick', sub { $self->on_nickchange(@_) });
|
$self->{pbot}->{event_dispatcher}->register_handler('irc.nick', sub { $self->on_nickchange(@_) }, 100 );
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('irc.public', sub { $self->on_activity(@_) });
|
$self->{pbot}->{event_dispatcher}->register_handler('irc.public', sub { $self->on_activity(@_) }, 0 );
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('irc.caction', sub { $self->on_activity(@_) });
|
$self->{pbot}->{event_dispatcher}->register_handler('irc.caction', sub { $self->on_activity(@_) }, 0 );
|
||||||
|
|
||||||
# handlers for the bot itself joining/leaving channels
|
# handlers for the bot itself joining/leaving channels
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('pbot.join', sub { $self->on_self_join(@_) });
|
$self->{pbot}->{event_dispatcher}->register_handler('pbot.join', sub { $self->on_self_join(@_) }, 0);
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('pbot.part', sub { $self->on_self_part(@_) });
|
$self->{pbot}->{event_dispatcher}->register_handler('pbot.part', sub { $self->on_self_part(@_) }, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub cmd_nicklist {
|
sub cmd_nicklist {
|
||||||
|
Loading…
Reference in New Issue
Block a user