plugins.github: Fix syntax error and wrong name

Fri, 07 Aug 2015 21:47:50 +0200

author
Kim Alvefur <zash@zash.se>
date
Fri, 07 Aug 2015 21:47:50 +0200
changeset 129
c9da10093c51
parent 128
5b03c71d05f0
child 130
8c0dd9360228

plugins.github: Fix syntax error and wrong name

plugins/github.lua file | annotate | diff | comparison | revisions
--- a/plugins/github.lua	Fri Aug 07 21:45:02 2015 +0200
+++ b/plugins/github.lua	Fri Aug 07 21:47:50 2015 +0200
@@ -25,9 +25,9 @@
 	bot:hook("commands/issue", function (command)
 		local issue_id = tonumber(command.param);
 		if not issue_id then return; end
-		local current_conf = conf[command.room and command.room.jid or "default"];
-		if not current_conf then return end
-		assert(http.request(issue_url(issue_id), ex, function (issue, code)
+		local current_conf = conf[command.room and command.room.jid] or conf;
+		if not current_conf.user then return end
+		assert(http.request(get_issue_url(issue_id), ex, function (issue, code)
 			if code > 400 then
 				return command:reply("HTTP Error "..code.." :(");
 			end
@@ -35,7 +35,7 @@
 			if not issue then
 				return command:reply("Got invalid JSON back :(");
 			end
-			command:reply(("%s #%d\n%s"):format(issue.title, issue.number issue.html_url));
+			command:reply(("%s #%d\n%s"):format(issue.title, issue.number, issue.html_url));
 		end));
 		return true;
 	end);

mercurial