Being able to send a note using the person's current nick instead of needing

to know their ircdb user name is good
This commit is contained in:
James Vega 2004-08-23 17:36:00 +00:00
parent 67a79c1ce9
commit 852388e8b7
2 changed files with 8 additions and 1 deletions

View File

@ -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.' % \

View File

@ -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')