mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Unix: Make configuration variable fortune.short channel-specific
This commit is contained in:
parent
43a3285f48
commit
751a3ef921
@ -58,7 +58,7 @@ conf.registerGroup(Unix, 'fortune')
|
||||
conf.registerGlobalValue(Unix.fortune, 'command',
|
||||
registry.String(utils.findBinaryInPath('fortune') or '', _("""Determines
|
||||
what command will be called for the fortune command.""")))
|
||||
conf.registerGlobalValue(Unix.fortune, 'short',
|
||||
conf.registerChannelValue(Unix.fortune, 'short',
|
||||
registry.Boolean(True, _("""Determines whether only short fortunes will be
|
||||
used if possible. This sends the -s option to the fortune program.""")))
|
||||
conf.registerGlobalValue(Unix.fortune, 'equal',
|
||||
|
@ -196,10 +196,11 @@ class Unix(callbacks.Plugin):
|
||||
|
||||
Returns a fortune from the *nix fortune program.
|
||||
"""
|
||||
channel = msg.args[0]
|
||||
fortuneCmd = self.registryValue('fortune.command')
|
||||
if fortuneCmd:
|
||||
args = [fortuneCmd]
|
||||
if self.registryValue('fortune.short'):
|
||||
if self.registryValue('fortune.short', channel):
|
||||
args.append('-s')
|
||||
if self.registryValue('fortune.equal'):
|
||||
args.append('-e')
|
||||
|
Loading…
Reference in New Issue
Block a user