diff --git a/plugins/Note.py b/plugins/Note.py index 321d56051..7b90924a1 100644 --- a/plugins/Note.py +++ b/plugins/Note.py @@ -219,7 +219,8 @@ class Note(callbacks.Privmsg): # Make sure the sender isn't being ignored. senderName = ircdb.users.getUser(fromId).name for name in names: - if senderName in self.userValue('ignores', name): + ignores = self.userValue('ignores', name) + if ignores and senderName in ignores: badnames.append(name) if badnames: irc.error('%s %s ignoring notes from you.' % \ diff --git a/test/test_Note.py b/test/test_Note.py index 01d1b0a2c..1b4d75e21 100644 --- a/test/test_Note.py +++ b/test/test_Note.py @@ -41,6 +41,7 @@ class NoteTestCase(PluginTestCase, PluginDocumentation): # setup a user self.prefix = 'foo!bar@baz' self.assertNotError('register inkedmn bar') + self.assertNotError('addhostmask inkedmn test2!bar@baz') def testSendnote(self): #print repr(ircdb.users.getUser(self.prefix)) @@ -51,6 +52,11 @@ class NoteTestCase(PluginTestCase, PluginDocumentation): self.assertError('note send alsdkjfasldk foo') self.assertNotError('note send inkedmn test2') _ = self.getMsg(' ') + # verify that sending a note to a user via their nick instead of their + # ircdb user name works + self.prefix = 'test2!bar@baz' + self.assertNotError('note send test2 foo') + _ = self.getMsg(' ') def testNote(self): self.assertNotError('note send inkedmn test')