Added followIdentificationThroughNickChanges for RFE #845346.

This commit is contained in:
Jeremy Fincher 2003-12-17 13:39:05 +00:00
parent 3334180c82
commit 29b0e20b2d
3 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,9 @@
* Added conf.followIdentificationThroughNickChanges for having the
bot update user's identified hostmask when they change nicks.
* Added conf.replyWhenNotAddressed, a configuration variable for
having the bot always attempt to parse a message as a command.
* Added Relay.command, a command for sending commands to the bot
on a different network.

View File

@ -159,6 +159,14 @@ replyWhenNotAddressed = False
###
requireRegistration = False
###
# followIdentificationThroughNickChanges: By default the bot will simply
# unidentify someone when he changes
# his nick. Setting this to True will
# cause the bot to track such changes.
###
followIdentificationThroughNickChanges = False
###
# enablePipeSyntax: Supybot allows nested commands; generally, commands are
# nested via [square brackets]. Supybot can also use a
@ -356,6 +364,7 @@ types = {
'detailedTracebacks': mybool,
'driverModule': mystr,
'showOnlySyntax': mybool,
'followIdentificationThroughNickChanges': mybool
}
if os.name == 'nt':

View File

@ -592,6 +592,19 @@ class Irc(IrcCommandDispatcher):
self.prefix = ircutils.joinHostmask(self.nick, user, domain)
self.prefix = intern(self.prefix)
log.info('Changing user 0 hostmask to %r' % self.prefix)
elif conf.followIdentificationThroughNickChanges:
try:
id = ircdb.users.getUserId(msg.prefix)
u = ircdb.users.getUser(id)
except KeyError:
return
if u.auth:
(_, user, host) = ircutils.splitHostmask(msg.prefix)
newhostmask = ircutils.joinHostmask(msg.args[0], user, host)
log.info('Following identification for %s: %s -> %s',
u.name, u.auth[1], newhostmask)
u.auth = (u.auth[0], newhostmask)
ircdb.users.setUser(id, u)
def feedMsg(self, msg):
"""Called by the IrcDriver; feeds a message received."""