LinkRelay: Add config variable to hide the nick of the author of a message. Closes GH-114.

master
Valentin Lorentz 2012-12-27 20:14:02 +01:00
parent 619a15a143
commit cd2301aa18
2 changed files with 5 additions and 0 deletions

View File

@ -67,6 +67,9 @@ conf.registerChannelValue(LinkRelay, 'hostmasks',
registry.Boolean(False, _("""Determines whether the bot will Relay the
hostmask of the person joining or parting the channel when he or she joins
or parts.""")))
conf.registerChannelValue(LinkRelay, 'nicks',
registry.Boolean(True, _("""Determines whether the bot will relay the
nick of the person sending a message.""")))
conf.registerChannelValue(LinkRelay, 'includeNetwork',
registry.Boolean(True, _("""Determines whether the bot will include the
network in Relayed PRIVMSGs; if you're only Relaying between two networks,

View File

@ -133,6 +133,8 @@ class LinkRelay(callbacks.Plugin):
color = self.simpleHash(nick)
if nick in self.nickSubstitutions:
nick = self.nickSubstitutions[nick]
if not self.registryValue('nicks', channel):
nick = ''
if re.match('^\x01ACTION .*\x01$', text):
text = text.strip('\x01')
text = text[ 7 : ]