From 59b92bdf3c01fa28b90632312a7eec0405e8b565 Mon Sep 17 00:00:00 2001 From: cws Date: Wed, 7 Jun 2017 14:46:34 -0400 Subject: [PATCH] fact: remove ownership check for delete --- plugins/fact/factoid.go | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/plugins/fact/factoid.go b/plugins/fact/factoid.go index a33eb1f..e9e8e1a 100644 --- a/plugins/fact/factoid.go +++ b/plugins/fact/factoid.go @@ -439,18 +439,15 @@ func (p *Factoid) forgetLastFact(message msg.Message) bool { p.Bot.SendMessage(message.Channel, "I refuse.") return true } - if message.User.Admin || message.User.Name == p.LastFact.Owner { - err := p.LastFact.delete(p.db) - if err != nil { - log.Println("Error removing fact: ", p.LastFact, err) - } - fmt.Printf("Forgot #%d: %s %s %s\n", p.LastFact.id.Int64, p.LastFact.Fact, - p.LastFact.Verb, p.LastFact.Tidbit) - p.Bot.SendAction(message.Channel, "hits himself over the head with a skillet") - p.LastFact = nil - } else { - p.Bot.SendMessage(message.Channel, "You don't own that fact.") + + err := p.LastFact.delete(p.db) + if err != nil { + log.Println("Error removing fact: ", p.LastFact, err) } + fmt.Printf("Forgot #%d: %s %s %s\n", p.LastFact.id.Int64, p.LastFact.Fact, + p.LastFact.Verb, p.LastFact.Tidbit) + p.Bot.SendAction(message.Channel, "hits himself over the head with a skillet") + p.LastFact = nil return true }