Mercurial > pidgin
comparison plugins/PERL-HOWTO @ 2511:a83b4a5ffcd6
[gaim-migrate @ 2524]
malsyned's patch for args in perl.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 15 Oct 2001 19:52:44 +0000 |
parents | 571971659533 |
children | bf7ec3874810 |
comparison
equal
deleted
inserted
replaced
2510:1950afffd107 | 2511:a83b4a5ffcd6 |
---|---|
120 This is the most important of them all. This is basically exactly like | 120 This is the most important of them all. This is basically exactly like |
121 gaim_signal_connect for plugins. You pass which event you want to connect to | 121 gaim_signal_connect for plugins. You pass which event you want to connect to |
122 (a string with the same name as the events for plugins, see SIGNALS), and a | 122 (a string with the same name as the events for plugins, see SIGNALS), and a |
123 string with the name of the function you want called. Simple enough? | 123 string with the name of the function you want called. Simple enough? |
124 | 124 |
125 When this is triggered, the arguments will be passed in @_ and are not | 125 When this is triggered, the arguments will be passed in @_ and are broken |
126 broken into a list, but left as one long string. You'll have to parse those | 126 into a list. This is different from all previous versions of Gaim, where you |
127 yourself with split. (Sounding exactly like X-Chat yet?) The arguments are | 127 had to parse the arguments yourself. The arguments are quite different from |
128 the exact same as those passed to the plugins, and are passed after the | 128 what's passed to the plugins, though they are very similar, and you should |
129 read perl.c to figure out what they are. The arguments are passed after the | |
129 plugins have had their way with them. Perl scripts cannot modify the values | 130 plugins have had their way with them. Perl scripts cannot modify the values |
130 so that gaim knows what the changes are. | 131 so that gaim knows what the changes are. |
131 | 132 |
132 Perl scripts can short-circuit certain events (namely event_im_send, | 133 Perl scripts can short-circuit certain events (namely event_im_send, |
133 event_im_recv, event_chat_send, and event_chat_recv). To short-circuit an | 134 event_im_recv, event_chat_send, and event_chat_recv). To short-circuit an |
134 event simply return a non-0 value. This will cause all subsequent scripts | 135 event simply return a non-0 value. This will cause all subsequent scripts |
135 and the event itself to never happen (i.e. the user won't see it happen, | 136 and the event itself to never happen (i.e. the user won't see it happen, |
136 and _send events won't actually send). | 137 and _send events won't actually send). |
137 | 138 |
138 Names of buddies and chat rooms will be in quotes, and all other | |
139 values (like text messages) will not be. (Watch the debug window to get a | |
140 better feel for this, or better yet, look at the bottom of plugins.c.) | |
141 | |
142 GAIM::add_timeout_handler(integer, function) | 139 GAIM::add_timeout_handler(integer, function) |
143 This calls function after integer number of seconds. It only calls function | 140 This calls function after integer number of seconds. It only calls function |
144 once, so if you want to keep calling function, keep readding the handler. | 141 once, so if you want to keep calling function, keep readding the handler. |