#NEWLINE# def _checkManageCapabilities( self , irc , msg , channel ) : #NEWLINE# #INDENT# 'Check if the user has any of the required capabilities to manage\n        the channel topic.\n\n        The list of required capabilities is in requireManageCapability\n        channel config.\n\n        Also allow if the user is a chanop. Since they can change the topic\n        manually anyway.\n        ' #NEWLINE# c = irc . state . channels [ channel ] #NEWLINE# if ( ( msg . nick in c . ops ) or ( msg . nick in c . halfops ) or ( 't' not in c . modes ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# capabilities = self . registryValue ( 'requireManageCapability' , channel ) #NEWLINE# if capabilities : #NEWLINE# #INDENT# for capability in re . split ( '\\s*;\\s*' , capabilities ) : #NEWLINE# #INDENT# if capability . startswith ( 'channel,' ) : #NEWLINE# #INDENT# capability = ircdb . makeChannelCapability ( channel , capability [ 8 : ] ) #NEWLINE# #UNINDENT# if ( capability and ircdb . checkCapability ( self . prefix , capability ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# #UNINDENT# capabilities = self . registryValue ( 'requireManageCapability' , channel ) #NEWLINE# irc . errorNoCapability ( capabilities , Raise = True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return