mirror of
				https://github.com/Mikaela/Limnoria.git
				synced 2025-10-30 23:27:24 +01:00 
			
		
		
		
	Added followIdentificationThroughNickChanges for RFE #845346.
This commit is contained in:
		
							parent
							
								
									3334180c82
								
							
						
					
					
						commit
						29b0e20b2d
					
				| @ -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. | ||||
| 	 | ||||
|  | ||||
| @ -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': | ||||
|  | ||||
| @ -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.""" | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jeremy Fincher
						Jeremy Fincher