use AnyEvent::XMPP::Ext::Disco;
use AnyEvent::XMPP::Ext::Version;
use AnyEvent::XMPP::Namespaces qw/xmpp_ns/;
+use AnyEvent::Redis;
my @msgs;
binmode STDOUT, ":utf8";
-our ($jid, $pw, $inputfile);
+our ($jid, $pw, $inputfile, $redis_host, $redis_port);
require 'config.pl';
warn "# $jid <- $inputfile\n";
$cl->add_account ($jid, $pw);
warn "connecting to $jid...\n";
+my $redis = AnyEvent::Redis->new( host => $redis_host, port => $redis_port );
+
$cl->reg_cb (
session_ready => sub {
my ($cl, $acc) = @_;
$repl->add_body ("You said '".$msg->any_body."' but... " . $talkmsg);
warn "Got message: '".$msg->any_body."' from ".$msg->from."\n";
warn "Answered: $talkmsg\n";
+
+ $redis->publish( join(' ', 'channel', $msg->from), $msg->any_body );
+
$repl->send;
},
contact_request_subscribe => sub {