Browse Source

Added channel targetting based on target name for notices.

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

13
client.go

@ -977,6 +977,18 @@ func (client *Client) handleEvent(event *Event) {
case "packet.notice":
{
// 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)
}
} else {
// Try to target by mentioned channel name
for _, token := range strings.Fields(event.Text) {
if client.isupport.IsChannel(token) {
@ -993,6 +1005,7 @@ func (client *Client) handleEvent(event *Event) {
break
}
}
}
// Otherwise, it belongs in the status target
if len(event.targets) == 0 {

Loading…
Cancel
Save