| 42 { |
42 { |
| 43 my ($account, $sender, $message, $conv, $flags, $data) = @_; |
43 my ($account, $sender, $message, $conv, $flags, $data) = @_; |
| 44 Purple::Debug::misc("signals test in perl", "$data (" . $account->get_username() . ", $sender, $message, $flags)\n"); |
44 Purple::Debug::misc("signals test in perl", "$data (" . $account->get_username() . ", $sender, $message, $flags)\n"); |
| 45 } |
45 } |
| 46 |
46 |
| |
47 sub timeout_cb |
| |
48 { |
| |
49 Purple::Debug::misc("signals test in perl", "timeout elapsed\n"); |
| |
50 } |
| |
51 |
| 47 sub plugin_load |
52 sub plugin_load |
| 48 { |
53 { |
| 49 my $plugin = shift; |
54 my $plugin = shift; |
| 50 |
55 |
| 51 # Hook to the signals |
56 # Hook to the signals |
| 69 $conv = Purple::Conversations::get_handle(); |
74 $conv = Purple::Conversations::get_handle(); |
| 70 Purple::Signal::connect($conv, "received-im-msg", $plugin, |
75 Purple::Signal::connect($conv, "received-im-msg", $plugin, |
| 71 \&conv_received_msg, "received im message"); |
76 \&conv_received_msg, "received im message"); |
| 72 Purple::Signal::connect($conv, "received-chat-msg", $plugin, |
77 Purple::Signal::connect($conv, "received-chat-msg", $plugin, |
| 73 \&conv_received_msg, "received chat message"); |
78 \&conv_received_msg, "received chat message"); |
| |
79 |
| |
80 |
| |
81 Purple::timeout_add($plugin, 10, \&timeout_cb); |
| 74 } |
82 } |
| 75 |
83 |
| 76 sub plugin_unload |
84 sub plugin_unload |
| 77 { |
85 { |
| 78 # Nothing to do here for this plugin. |
86 # Nothing to do here for this plugin. |