Mercurial > pidgin
comparison plugins/tcl/TCL-HOWTO @ 8999:8f838ae3e710
[gaim-migrate @ 9774]
" This patch renames the existing received-*-msg signals
to receiving-*msg to fit the naming of other signals
where a pointer to the message is passed (writing,
sending, displaying)
It adds new received-*-msg signals which are emitted
after the receiving signals, in line with the other
conversation signals (wrote, sent, displayed)
This is necessary to allow plugins which depend on the
final received message to work alongside plugins which
may modify the message.
One known example of this is festival-gaim alongside
gaim-encryption - festival-gaim would try to "speak"
the encrypted text:
http://sf.net/tracker/?func=detail&aid=943216&group_id=89763&atid=591320
I've tested this with gaim-encryption and festival-gaim
(locally modified so gaim-encryption uses the receiving
signal and festival uses the received signal)
All in-tree users of received-*-msg are updated to use
receiving-*-msg if they do modify the message, the
conversation-signals documentation is updated, the
signals-test.c & signal-test.tcl plugins are also updated." --Stu Tomlinson
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Fri, 21 May 2004 14:33:32 +0000 |
parents | 552dd5d5641e |
children |
comparison
equal
deleted
inserted
replaced
8998:3738d1eac0ad | 8999:8f838ae3e710 |
---|---|
294 | 294 |
295 Check the file SIGNALS for the meaning of these signals; this is | 295 Check the file SIGNALS for the meaning of these signals; this is |
296 intended to be a list only of their arguments. Signal callbacks will | 296 intended to be a list only of their arguments. Signal callbacks will |
297 be made in their own namespace, and arguments to those signal | 297 be made in their own namespace, and arguments to those signal |
298 callbacks will live in the namespace 'event' underneath that | 298 callbacks will live in the namespace 'event' underneath that |
299 namespace. To briefly illustrate, the signal received-im-msg is | 299 namespace. To briefly illustrate, the signal receiving-im-msg is |
300 provided with three arguments; the account on which the IM was | 300 provided with three arguments; the account on which the IM was |
301 received, the screen name of the user sending the IM, and the text of | 301 received, the screen name of the user sending the IM, and the text of |
302 the IM. These arguments live in the variables event::account, | 302 the IM. These arguments live in the variables event::account, |
303 event::sender, and event::buffer, respectively. Therefore a callback | 303 event::sender, and event::buffer, respectively. Therefore a callback |
304 which notifies the user of an incoming IM containing the word 'shizzle' | 304 which notifies the user of an incoming IM containing the word 'shizzle' |
305 might look like this: | 305 might look like this: |
306 | 306 |
307 gaim::signal connect [gaim::conversation handle] received-im-msg { | 307 gaim::signal connect [gaim::conversation handle] receiving-im-msg { |
308 if {[ string match "*shizzle*" $event::buffer ]} { | 308 if {[ string match "*shizzle*" $event::buffer ]} { |
309 gaim::notify -info "tcl plugin" "Fo' shizzle" \ | 309 gaim::notify -info "tcl plugin" "Fo' shizzle" \ |
310 "$event::sender is down with the shizzle" | 310 "$event::sender is down with the shizzle" |
311 } | 311 } |
312 } | 312 } |
313 | 313 |
314 Note that for some signals (notably received-im-msg, sending-im-msg, | 314 Note that for some signals (notably receiving-im-msg, sending-im-msg, |
315 and their chat counterparts), changes to the event arguments will | 315 and their chat counterparts), changes to the event arguments will |
316 change the message itself from Gaim's vantage. For those signals | 316 change the message itself from Gaim's vantage. For those signals |
317 whose return value is meaningful, returning a value from the Tcl event | 317 whose return value is meaningful, returning a value from the Tcl event |