Prevent doubled messages by lowering nicknames in tell plugin and adding unique constraint on to_user and message

This commit is contained in:
mrhanky 2017-05-18 14:49:27 +02:00
parent 04601fdf39
commit f2f436e90a
No known key found for this signature in database
GPG Key ID: 67D772C481CB41B8

View File

@ -34,7 +34,7 @@ class Tell(DatabasePlugin):
nick = args['<nick>'].lower() nick = args['<nick>'].lower()
if nick not in self.tell_queue: if nick not in self.tell_queue:
self.tell_queue[nick] = [] self.tell_queue[nick] = []
tell = [mask.nick.lower(), nick, ' '.join(args['<message>'])] tell = [mask.nick.lower(), nick, ' '.join(args['<message>']).strip()]
self.tell_queue[nick].append(tell) self.tell_queue[nick].append(tell)
self.cur.execute('insert into tells (from_user, to_user, message)' self.cur.execute('insert into tells (from_user, to_user, message)'
'values (?, ?, ?)', tell) 'values (?, ?, ?)', tell)