/usr/share/amsn/plugins/changeit/changeit.tcl is in amsn-data 0.98.9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | namespace eval ::changeit {
variable config
variable configlist
proc InitPlugin { dir } {
::plugins::RegisterPlugin changeit
source [file join $dir changeit.tcl]
::plugins::RegisterEvent changeit chat_msg_receive msgReceive
::plugins::RegisterEvent changeit chat_msg_send msgSend
array set ::changeit::config {
sent {0}
received {1}
filter {/usr/local/bin/pirate}
}
set ::changeit::configlist [list \
[list bool "Filter sent messages" sent] \
[list bool "Filter received messages" received] \
[list str "Location to filter" filter] \
]
}
proc msgReceive {event evpar} {
variable config
if { $config(received) } {
upvar 2 user user
set email $user
if { $email != [::config::getKey login] } {
upvar 2 msg msg
set msg [exec echo "$msg" | $config(filter)]
return $msg
}
}
}
proc msgSend {event evpar} {
variable config
if { $config(sent) } {
upvar 2 msg msg
set msg [exec echo "$msg" | $config(filter)]
return $msg
}
}
}
|