mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-09 02:54:13 +01:00
Fix some more exceptions from not using plugins.getUserName
This commit is contained in:
parent
f03c753828
commit
b28880ff0a
@ -274,11 +274,11 @@ class Note(callbacks.Privmsg):
|
|||||||
def _formatNote(self, note, to):
|
def _formatNote(self, note, to):
|
||||||
elapsed = utils.timeElapsed(time.time() - note.at)
|
elapsed = utils.timeElapsed(time.time() - note.at)
|
||||||
if note.to == to:
|
if note.to == to:
|
||||||
author = ircdb.users.getUser(note.frm).name
|
author = plugins.getUserName(note.frm)
|
||||||
return '%s (Sent by %s %s ago)' % (note.text, author, elapsed)
|
return '%s (Sent by %s %s ago)' % (note.text, author, elapsed)
|
||||||
else:
|
else:
|
||||||
assert note.frm == to, 'Odd, userid isn\'t frm either.'
|
assert note.frm == to, 'Odd, userid isn\'t frm either.'
|
||||||
recipient = ircdb.users.getUser(note.to).name
|
recipient = plugins.getUserName(note.to)
|
||||||
return '%s (Sent to %s %s ago)' % (note.text, recipient, elapsed)
|
return '%s (Sent to %s %s ago)' % (note.text, recipient, elapsed)
|
||||||
|
|
||||||
def note(self, irc, msg, args, user, id):
|
def note(self, irc, msg, args, user, id):
|
||||||
@ -304,10 +304,10 @@ class Note(callbacks.Privmsg):
|
|||||||
def _formatNoteId(self, msg, note, sent=False):
|
def _formatNoteId(self, msg, note, sent=False):
|
||||||
if note.public or not ircutils.isChannel(msg.args[0]):
|
if note.public or not ircutils.isChannel(msg.args[0]):
|
||||||
if sent:
|
if sent:
|
||||||
sender = ircdb.users.getUser(note.to).name
|
sender = plugins.getUserName(note.to)
|
||||||
return '#%s to %s' % (note.id, sender)
|
return '#%s to %s' % (note.id, sender)
|
||||||
else:
|
else:
|
||||||
sender = ircdb.users.getUser(note.frm).name
|
sender = plugins.getUserName(note.frm)
|
||||||
return '#%s from %s' % (note.id, sender)
|
return '#%s from %s' % (note.id, sender)
|
||||||
else:
|
else:
|
||||||
return '#%s (private)' % note.id
|
return '#%s (private)' % note.id
|
||||||
|
Loading…
Reference in New Issue
Block a user