Browse Source

Added channel targetting based on target name for notices.

master
Gisle Aune 6 years ago
parent
commit
6cc8ae37c9
  1. 31
      client.go

31
client.go

@ -977,20 +977,33 @@ func (client *Client) handleEvent(event *Event) {
case "packet.notice":
{
// Try to target by mentioned channel name
for _, token := range strings.Fields(event.Text) {
if client.isupport.IsChannel(token) {
channel := client.Channel(token)
if channel == nil {
continue
}
// Find channel target
targetName := event.Arg(0)
if client.isupport.IsChannel(targetName) {
channel := client.Channel(targetName)
if channel != nil {
if user, ok := channel.UserList().User(event.Nick); ok {
event.RenderTags["prefixedNick"] = user.PrefixedNick
}
client.handleInTarget(channel, event)
break
}
} else {
// Try to target by mentioned channel name
for _, token := range strings.Fields(event.Text) {
if client.isupport.IsChannel(token) {
channel := client.Channel(token)
if channel == nil {
continue
}
if user, ok := channel.UserList().User(event.Nick); ok {
event.RenderTags["prefixedNick"] = user.PrefixedNick
}
client.handleInTarget(channel, event)
break
}
}
}

Loading…
Cancel
Save