Created
March 27, 2010 15:40
-
-
Save farhaven/346164 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use vars qw($VERSION %IRSSI); | |
use Irssi; | |
$VERSION = '0.2'; | |
%IRSSI = ( | |
authors => 'gbe/smile', | |
name => 'bitlbee_autojoin_groupchats', | |
description => 'autojoins groupchats in bitlbee', | |
license => 'MIT' | |
); | |
my %groupchats = ( | |
'jabber' => [ | |
'[email protected]', | |
] | |
); | |
sub autojoin_groupchat | |
{ | |
my ($server, $data, $nick, $adress) = @_; | |
my ($target, $msg) = split(/ :/, $data, 2); | |
if (($target eq "&bitlbee") && ($msg =~ /(.+) - Logging in: Logged in/)) | |
{ | |
my $account = $1; | |
my @chats = @{$groupchats{$account} or [] }; | |
foreach my $c (@chats) | |
{ | |
$server->send_message($target, 'join_chat ' . $account . ' ' . $c, 0); | |
} | |
} | |
} | |
Irssi::signal_add('event privmsg', 'autojoin_groupchat'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment