Skip to content

Commit

Permalink
Cleanup state when we disconnect.
Browse files Browse the repository at this point in the history
  • Loading branch information
DasBrain committed Apr 17, 2021
1 parent f8f6ff7 commit 3b365d1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tcl/keepnick/keepnick.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ proc keepnick:connected {} {
}

on XC_UCHANGENICK keepnick {
variable wantednicks
global wantednicks
set sid [serverid]
if {[dict exists $wantednicks $sid]} {
set newnick [lindex $_raw 2]
Expand All @@ -45,7 +45,7 @@ on XC_UCHANGENICK keepnick {
}

on QUIT keepnick {
variable wantednicks
global wantednicks
set sid [serverid]
if {[dict exists $wantednicks $sid]} {
set wanted [dict get $wantednicks $sid]
Expand All @@ -54,4 +54,9 @@ on QUIT keepnick {
command "NICK $wanted"
}
}
}

on XC_DISCON keepnick {
global wantednicks
dict unset wantednicks [serverid]
}

0 comments on commit 3b365d1

Please sign in to comment.