4 my $password = "kyrios";
5 my $loggedAccount = "mcepl\@porky.stuttgart.redhat.com";
10 name
=> "Perl: Login to $botname",
12 summary
=> "Logs to $botname on RH IRC",
13 description
=> "Send login to $botname on login to the IRC account.",
14 author
=> "Matěj Cepl <mcepl\@redhat.com>",
15 url
=> "http://matej.ceplovi.cz",
16 load
=> "plugin_load",
17 unload
=> "plugin_unload",
20 #(00:25:06) charding: Can anyone tell me what's the difference
21 #between the 'signing-on' and 'account-connecting' signals? Is
22 #signing-on for when pidgin is starting up? and account-connecting
23 #is when pidgin is already running and you enable and that
24 #particular acct is connecting?
25 #(00:29:18) elb: charding: as best I can tell, the only difference is that
26 #signing-on is called for both registration and regular
27 #connection, and account-connecting is called only for the later
28 #(00:29:22) elb: latter
29 #(00:29:28) elb: they're emitted one right after another in
30 #purple_connection_new
34 Purple
::Debug
::info
("loginRHIRC", "start paramterers=@_\n");
37 $conn = Purple
::Connections
::get_handle
();
38 Purple
::Signal
::connect($conn, "signed-on", $plugin,
40 Purple
::Debug
::info
("loginRHIRC", "Login to $botname plugin loaded\n");
44 Purple
::Debug
::info
("loginRHIRC", "Login to $botname plugin unloaded\n");
49 my $account = $conn->get_account();
50 my $username = $account->get_username();
51 Purple
::Debug
::misc
("loginRHIRC", "signed-on (" . $username . ")\n");
54 if ($username eq $loggedAccount) {
55 my $ret = Purple
::Prpl
::send_raw
($conn,
56 ":$login PRIVMSG $botname :login $login $password\n");
57 Purple
::Debug
::misc
("loginRHIRC", "ret=$ret\n");
60 # Purple::timeout_add();
63 my @allChats = Purple
::get_ims
();
64 my @allTitles = map($_->get_title(),@allChats);
65 Purple
::Debug
::misc
("loginRHIRC", "\@allTitles=@allTitles\n");
66 Purple
::Debug
::misc
("loginRHIRC", "Purple::get_ims() = " . Purple
::get_ims
());
67 my @userservChats = grep ((
68 $_->get_title() =~ /^\W*$botname\W*$/
69 ), Purple
::get_ims
());
70 $userservChats[1]->destroy();