From 852388e8b7f9aabbf8b10c16511d2ebf125edf2b Mon Sep 17 00:00:00 2001 From: James Vega Date: Mon, 23 Aug 2004 17:36:00 +0000 Subject: [PATCH] Being able to send a note using the person's current nick instead of needing to know their ircdb user name is good --- plugins/Note.py | 3 ++- test/test_Note.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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')