diff --git a/viera.yaml.example b/viera.yaml.example index 02d328a..ee1fb7f 100644 --- a/viera.yaml.example +++ b/viera.yaml.example @@ -25,10 +25,17 @@ irc: # channels for the bot to join channels: - '#mychannel' + - '#myotherchannel' # channels for the bot to relay AP posts to relay_channels: - - '#mychannel' + + # allow any AP actor to be relayed + '#mychannel': [] + + # allow only one AP actor to be relayed + '#myotherchannel': + - 'https://example.org/~alyssa' # IRC services credentials. sasl_username: viera diff --git a/viera/irc.py b/viera/irc.py index 16f951c..01be975 100644 --- a/viera/irc.py +++ b/viera/irc.py @@ -254,8 +254,9 @@ class IRCProtocol(asyncio.Protocol): if len(content) > 256: msgcontent += '...' + targets = [chan for chan, actors in IRC_CONFIG['relay_channels'].items() if not actors or actor['id'] in actors] message = fmt.format(name=actor['name'], content=msgcontent, url=obj['id']) - target = ','.join(IRC_CONFIG['relay_channels']) + target = ','.join(targets) self.say(target, message)