42wim / matterircd

Connect to your mattermost or slack using your IRC-client of choice.
MIT License
294 stars 60 forks source link

Fix mentions for every message #562

Closed hloeung closed 12 months ago

hloeung commented 12 months ago

This fixes https://github.com/42wim/matterircd/issues/561

If NotifyProps["mention_keys"] (aka "Words That Trigger Mentions") is empty, strings.Split(mentionkeys, ",") creates a slice with one element, the empty string - []string{""} rather than an empty slice ([]string{}). This causes all lines to match.

We can handle it at the strings.Split(), or around it. But I thought best to handle it in the loop in case the user does something like test1,test2,,test3 where there is an accidental comma.