Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Passing more info to callbacks

  • Loading branch information...
commit 4894ac5b6879e8ffb17f7726e48df332508b3d6f 1 parent b40343a
@tadzik authored
Showing with 8 additions and 2 deletions.
  1. +6 −1 xmpbot.pm
  2. +2 −1  xmpbot/Plugin/Echo.pm
View
7 xmpbot.pm
@@ -68,7 +68,12 @@ sub BUILD {
my ($user) = split(/\//, $msg->from);
$plugin->loc->set_languages($self->db->getOption($user, 'lang'));
}
- my $ret = $plugin->$comm($args);
+ my $ret = $plugin->$comm($args,
+ {
+ jid => $acc->jid,
+ raw => $msg,
+ }
+ );
if ($ret) {
$repl = $msg->make_reply;
$repl->add_body($ret);
View
3  xmpbot/Plugin/Echo.pm
@@ -8,7 +8,8 @@ sub BUILD {
}
sub echo {
- my ($self, $msg) = @_;
+ my ($self, $msg, $data) = @_;
+ warn "Echo/log: $data->{jid} said exactly $data->{raw}\n";
return $msg;
}
Please sign in to comment.
Something went wrong with that request. Please try again.