Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package eventMacro::Condition::BusMsg;
- use strict;
- use Globals;
- use Utils;
- use base 'eventMacro::Condition::BaseMsg';
- sub _hooks {
- my ( $self ) = @_;
- my $hooks = $self->SUPER::_hooks;
- my @other_hooks = ('bus_received');
- push(@{$hooks}, @other_hooks);
- return $hooks;
- }
- sub validate_condition {
- my ( $self, $callback_type, $callback_name, $args ) = @_;
- if ($callback_type eq 'hook') {
- $self->{message} = $args->{message};
- if (exists $args->{sender}) {
- $self->{source} = $args->{sender};
- } else {
- $self->{source} = undef;
- }
- }
- return $self->SUPER::validate_condition( $callback_type, $callback_name, $args );
- }
- sub usable {
- 1;
- }
- 1;
Advertisement
Add Comment
Please, Sign In to add comment