mirror of
https://github.com/IllusionMan1212/gorc.git
synced 2026-10-24 02:12:33 +00:00
feat: remove parted channel from tab bar
This commit is contained in:
@@ -131,10 +131,19 @@ func handlePart(msg parser.IRCMessage, client *irc.Client) {
|
||||
|
||||
for i, c := range client.Channels {
|
||||
if c.Name == channel {
|
||||
if nick == client.Nickname {
|
||||
client.Channels = append(client.Channels[:i], client.Channels[i+1:]...)
|
||||
if client.ActiveChannelIndex >= i {
|
||||
client.ActiveChannelIndex--
|
||||
client.ActiveChannel = client.Channels[client.ActiveChannelIndex].Name
|
||||
}
|
||||
client.LastTabIndexInTabBar--
|
||||
} else {
|
||||
client.Channels[i].History += partMsg + irc.CRLF
|
||||
delete(client.Channels[i].Users, nick)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
client.Tea.Send(cmds.SwitchChannels())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user