irc: ensure only privileged accounts may follow/unfollow

This commit is contained in:
William Pitcock 2018-08-17 19:56:18 -05:00
parent 3e446bc584
commit 94d4efbe11
1 changed files with 5 additions and 0 deletions

View File

@ -123,6 +123,11 @@ class IRCProtocol(asyncio.Protocol):
elif 'whois' in action:
self.whois(nickname, action['whois'], account)
elif 'follow' in action:
data = fetch_auth(account)
if not data:
return
if data not in IRC_CONFIG['privileged']:
return
logging.info('allowed follow: %r', action['follow'])
self.follow(nickname, action['follow'])