/usr/share/amsn/plugins/ebuddykiller/ebuddykiller.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 | namespace eval ::ebuddykiller {
variable loaded
proc Init { dir } {
variable loaded
if {[info exists loaded] && $loaded == 1} {
return
}
if { [info commands ::NS::Snit_methodsetInitialNicknameCB] != "" && [info commands ::NS::Snit_methodsetInitialNicknameKilled] == "" } {
rename ::NS::Snit_methodsetInitialNicknameCB ::NS::Snit_methodsetInitialNicknameKilled
} else {
return
}
::plugins::RegisterPlugin eBuddyKiller
plugins_log "eBuddyKiller" "We are being executed"
proc ::NS::Snit_methodsetInitialNicknameCB { type selfns win self newstate newstate_custom nickname last_modif psm fail } {
plugins_log "eBuddyKiller" "Callback called"
set force 0
if { [string first "ebuddy" $psm] >= 0 } {
plugins_log "eBuddyKiller" "eBuddy PSM killed!!!"
set psm [::abook::getPersonal PSM]
set force 1
if { [xmldecode $nickname] != $nickname } {
#eBuddy xmlencoded our nickname... got to change it back
set nickname [xmldecode $nickname]
}
}
eval ::NS::Snit_methodsetInitialNicknameKilled [list $type $selfns $win $self $newstate $newstate_custom $nickname $last_modif $psm $fail]
if { $force == 1 } {
#Update our stuff on the server
::MSN::changeName $nickname 1
::MSN::changePSM $psm [::MSN::myStatusIs] 1 1
}
}
set loaded 1
}
proc DeInit { } {
variable loaded
status_log "Restoring previous proc body\n"
;# this will return the list of arguments a command can take
if { [info commands ::NS::Snit_methodsetInitialNicknameKilled] != "" } {
rename ::NS::Snit_methodsetInitialNicknameCB ""
rename ::NS::Snit_methodsetInitialNicknameKilled ::NS::Snit_methodsetInitialNicknameCB
}
set loaded 0
}
}
|