Skip to content

Commit

Permalink
Fix case sensitivity bug in seen plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmaguire committed Jun 8, 2021
1 parent 70e175c commit 5daa4e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/seen/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def irc_quit(self, cardinal, user, reason):
# TODO Add irc_kick/irc_kicked

def do_tell(self, nick):
nick = nick.lower()

with self.db() as db:
if nick in db['tells']:
for message in db['tells'][nick]:
Expand Down Expand Up @@ -215,7 +217,7 @@ def seen(self, cardinal, user, channel, msg):
except IndexError:
return cardinal.sendMsg(channel, 'Syntax: .seen <user>')

if nick == user.nick:
if nick.lower() == user.nick.lower():
cardinal.sendMsg(channel, "{}: Don't be daft.".format(user.nick))
return

Expand All @@ -231,10 +233,12 @@ def tell(self, cardinal, user, channel, msg):
cardinal.sendMsg(channel, "Syntax: .tell <nick> <message>")
return

if nick == user.nick:
if nick.lower() == user.nick.lower():
cardinal.sendMsg(channel, "{}: Don't be daft.".format(user.nick))
return

nick = nick.lower()

with self.db() as db:
tells = db['tells'].get(nick, [])
tells.append({
Expand Down

0 comments on commit 5daa4e6

Please sign in to comment.