Jason R. Coombs committed 2733bfd

Include the channel in the URL if the current channel is currently logged.

Comments (0)

Files changed (2)

+* Include channel in hyperlink for logs for logged channels.


 import traceback
 import pytz
+import six
 import pmxbot
 from . import storage
 @command("logs", doc="Where can one find the logs?")
 def logs(client, event, channel, nick, rest):
-	return pmxbot.config.get('logs URL')
+	base = pmxbot.config.get('logs URL')
+	logged_channel = channel in pmxbot.config.log_channels
+	path = '/channel/' + channel.lstrip('#') if logged_channel else '/'
+	return six.urllib.parse.urljoin(base, path)
 @command("log", doc="Enable or disable logging for a channel; use 'please' "
 	"to start logging and 'stop please' to stop.")