Announce bug changes to the new D-Bus Globster
This commit is contained in:
parent
e5fe5c859a
commit
4471f9028f
1 changed files with 7 additions and 23 deletions
30
index.cgi
30
index.cgi
|
|
@ -276,30 +276,14 @@ sub bug_post {
|
||||||
return $s->htmlFooter;
|
return $s->htmlFooter;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Experimental: announce this report to the ncdc hub, through the globster bot
|
# Announce this report to the ncdc hub, through the globster bot
|
||||||
my $sock = '/tmp/globster.sock';
|
eval {
|
||||||
if(-e $sock) {
|
$ENV{DBUS_SESSION_BUS_ADDRESS} = 'unix:path=/tmp/dbus-globster';
|
||||||
|
require Net::DBus;
|
||||||
my $msg = "Bug activity for $p: $l->{summary} -> http://dev.yorhel.nl/$p/bug/$l->{issue}";
|
my $msg = "Bug activity for $p: $l->{summary} -> http://dev.yorhel.nl/$p/bug/$l->{issue}";
|
||||||
require AnyEvent;
|
Net::DBus->find->get_service("net.blicky.Globster")->get_object("/net/blicky/Globster/Hub/1")->SendChat(-1, $msg, 0);
|
||||||
require AnyEvent::Handle;
|
1;
|
||||||
require AnyEvent::Socket;
|
} || warn $@;
|
||||||
require Tanja;
|
|
||||||
my $done = AnyEvent->condvar;
|
|
||||||
my $node = Tanja::Node->new();
|
|
||||||
AnyEvent::Socket::tcp_connect('unix/', $sock, sub {
|
|
||||||
my $fh = shift;
|
|
||||||
warn $! && $done->send if !$fh;
|
|
||||||
my $lnk; $lnk = $fh && $node->link(handle => AnyEvent::Handle->new(fh => $fh),
|
|
||||||
sync => 0,
|
|
||||||
on_error => sub { $_[0]&&warn$_[0]; $done->send },
|
|
||||||
on_ready => sub {
|
|
||||||
$node->send([hub=>ncdc=>chat=>undef,0,$msg]);
|
|
||||||
$lnk->close;
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
$done->recv;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue