# This will uninstall no!spam from your eggdrop.
# Just replace this with your current no.spam.tcl and rehash.

#---------------------------------------------------------------------------------------
# do not edit anything below

if {[info exists nospam-uninstalled] && ${nospam-uninstalled} == 2} {return 0}

foreach t [timers] {if {[strcomp [lindex [split $t] 1] nospam_cycle]} {killtimer [lindex $t 2]}}

if {${spam-chan-check}} {catch {unbind raw - PRIVMSG chan:abuse}}
if {${spam-invt-check}} {catch {unbind raw - INVITE invt:abuse}}
if {${spam-notc-check}} {catch {unbind raw - NOTICE notc:abuse}}
if {${spam-part-check}} {catch {unbind raw - PART part:abuse}}
if {${spam-priv-check}} {catch {unbind msgm - * priv:abuse}}
if {${spam-file-check}} {catch {unbind ctcp - DCC file:abuse}}

catch {unbind dcc ${spam-dcc-flag} +spam dcc:+spam}
catch {unbind dcc ${spam-dcc-flag} -spam dcc:-spam}
catch {unbind dcc ${spam-dcc-flag} spams dcc:spams}
catch {unbind dcc ${spam-dcc-flag} +spamchan dcc:+spamchan}
catch {unbind dcc ${spam-dcc-flag} -spamchan dcc:-spamchan}
catch {unbind dcc ${spam-dcc-flag} spamchans dcc:spamchans}

catch {unset spam_file(chan) spam_file(file) spam_file(invt) spam_file(part) spam_file(priv)}
catch {unset spam-chan-matches spam-notc-matches spam-part-matches spam-priv-matches spam_chans}
catch {unset spam-chan-file spam-ignore-flag spam-dcc-flag spam-log spam-log-file}
catch {unset spam-chan-check spam-file-check spam-invt-check spam-notc-check spam-part-check spam-priv-check}
catch {unset spam-chan-global spam-file-global spam-invt-global spam-notc-global spam-part-global spam-priv-global}
catch {unset spam-chan-mask spam-file-mask spam-invt-mask spam-notc-mask spam-part-mask spam-priv-mask}
catch {unset spam-chan-time spam-file-time spam-invt-time spam-notc-time spam-part-time spam-priv-time}
catch {unset spam-chan-reason spam-file-reason spam-invt-reason spam-notc-reason spam-part-reason spam-priv-reason}
catch {unset spam-file-cycle spam-file-interval spam-file-rand spam-file-safe spam_file_warn spam-file-lower}

catch {rename dcc:spamchans ""}
catch {rename dcc:-spamchan ""}
catch {rename dcc:+spamchan ""}
catch {rename dcc:+spam ""}
catch {rename dcc:-spam ""}
catch {rename dcc:spams ""}
catch {rename file:abuse ""}
catch {rename invt:abuse ""}
catch {rename priv:abuse ""}
catch {rename notc:abuse ""}
catch {rename chan:abuse ""}
catch {rename part:abuse ""}
catch {rename nospam_cycle ""}
catch {rename nospam_ctimer ""}
catch {rename cyclechan ""}
catch {rename sl_write ""}
catch {rename scf_remove ""}
catch {rename scf_append ""}
catch {rename scf_remtype ""}
catch {rename scf_addtype ""}
catch {rename scf_getentry ""}
catch {rename scf_read ""}
catch {rename scf_write ""}
catch {rename sf_remove ""}
catch {rename sf_append ""}
catch {rename sf_matches ""}
catch {rename sf_read ""}
catch {rename sf_write ""}
catch {rename spamsyntax ""}
catch {rename spamban ""}
catch {rename spammask ""}
catch {rename spamignore ""}
catch {rename spamchan ""}
catch {rename fulltype ""}
catch {rename pushkick ""}
catch {rename ctrl:filter ""}
catch {rename ns:chanban ""}
catch {raname ns:ban ""}
catch {rename ns:rand ""}

set nospam-uninstalled 2

putlog "no!spam.tcl has been uninstalled"
putlog "\002Don't forget to remove the 'source' line from your config!"
