commit 669f819fae5666d2da78ad38b852f7104601f6fe
parent e92f19f7661bef1da0d7dfd781a05646c3957c2c
Author: Emile 'iMil' Heitor <imil@NetBSD.org>
Date: Sat, 15 Jul 2023 08:28:22 +0200
fix: cleanup
Diffstat:
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/main.go b/main.go
@@ -46,9 +46,7 @@ func newsExists(news News) bool {
// Retrieve a news by its hash
func getNewsByHash(hash string) News {
- if strings.Contains(hash, "#") {
- hash = hash[1:]
- }
+ hash = strings.ReplaceAll(hash, "#", "")
for _, n := range newsList {
if n.Hash == hash {
return n
@@ -270,10 +268,8 @@ func main() {
if len(e.Params) > 0 && e.Params[0] != channel {
dest = e.Source.Name
}
- if strings.HasPrefix(e.Last(), "!die") {
- if isOp(e.Source.Name) {
- c.Close()
- }
+ if isOp(e.Source.Name) && strings.HasPrefix(e.Last(), "!die") {
+ c.Close()
}
if strings.HasPrefix(e.Last(), "!lsfeeds") {
for i, f := range viper.GetStringSlice("feeds.urls") {