From 67f88097dff833ca2f5b5af9f384ad1b13442f39 Mon Sep 17 00:00:00 2001 From: Thomas Menari Date: Sun, 24 Mar 2013 19:26:27 +0000 Subject: [PATCH 1/8] Update strings.json --- modules/spotify/strings.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/spotify/strings.json b/modules/spotify/strings.json index 9899843..b69a311 100644 --- a/modules/spotify/strings.json +++ b/modules/spotify/strings.json @@ -1,18 +1,18 @@ { "artist": { - "english": "{s} [artist] {artist}" + "en": "{s} [artist] {artist}" }, "album": { - "english": "{s} [album] {artist} – {album}" + "en": "{s} [album] {artist} – {album}" }, "track": { - "english": "{s} [track] {artist} – {track} (from {album})" + "en": "{s} [track] {artist} – {track} (from {album})" }, "found": { - "english": "{s} [{url}] {artist} – {track} (from {album})" + "en": "{s} [{url}] {artist} – {track} (from {album})" }, "not-found": { - "english": "{s} No results.", - "na'vi": "{s}, Oel ke tsun rivum ayuoti." + "en": "{s} No results.", + "nvi": "{s}, Oel ke tsun rivum ayuoti." } } From 681f56f46531a93806953a6618a943d4d3a2819c Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Sun, 24 Mar 2013 19:31:58 +0000 Subject: [PATCH 2/8] =?UTF-8?q?nvi=20=E2=86=92=20na'vi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/spotify/strings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/spotify/strings.json b/modules/spotify/strings.json index b69a311..bb50931 100644 --- a/modules/spotify/strings.json +++ b/modules/spotify/strings.json @@ -13,6 +13,6 @@ }, "not-found": { "en": "{s} No results.", - "nvi": "{s}, Oel ke tsun rivum ayuoti." + "na'vi": "{s}, Oel ke tsun rivum ayuoti." } } From c376ab97ac383b03e41e054bd428116920ba7217 Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 25 Mar 2013 17:04:49 +0000 Subject: [PATCH 3/8] bump jsbot --- jsbot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsbot b/jsbot index 217d7c8..84a4783 160000 --- a/jsbot +++ b/jsbot @@ -1 +1 @@ -Subproject commit 217d7c8f865e9097b06df3d6a3a58e544e79ac8e +Subproject commit 84a4783db76bdd729bd720c43485893ebe78a8c9 From 6176dd569511e8a9adba60889c95626163178cb5 Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 25 Mar 2013 18:23:35 +0000 Subject: [PATCH 4/8] fix crash on too big of a request [Close #332] --- modules/link/link.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/link/link.js b/modules/link/link.js index e07c178..94a2287 100644 --- a/modules/link/link.js +++ b/modules/link/link.js @@ -11,7 +11,9 @@ var link = function(dbot) { this.urlRegex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; this.links = {}; this.fetchTitle = function(event, link) { - request(link, function(error, response, body) { + var limit = 25 * 1000, + size = 0, + page = request(link, function(error, response, body) { if(!error && response.statusCode == 200) { body = body.replace(/(\r\n|\n\r|\n)/gm, " "); var title = body.valMatch(/(.*)<\/title>/, 2); @@ -20,6 +22,14 @@ var link = function(dbot) { } } }); + + page.on('data', function(chunk) { + size += chunk.length; + if(size > limit) { + page.abort(); + event.reply('request too big, fuck off'); + } + }); }; var commands = { From e9b4a9f11205b5330189224958f2b801006203f4 Mon Sep 17 00:00:00 2001 From: reality <tinmachin3@gmail.com> Date: Mon, 25 Mar 2013 18:26:13 +0000 Subject: [PATCH 5/8] give reasonable size limit [#332] --- modules/link/link.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/link/link.js b/modules/link/link.js index 94a2287..b6fa9f4 100644 --- a/modules/link/link.js +++ b/modules/link/link.js @@ -11,7 +11,7 @@ var link = function(dbot) { this.urlRegex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; this.links = {}; this.fetchTitle = function(event, link) { - var limit = 25 * 1000, + var limit = 250 * 1000, size = 0, page = request(link, function(error, response, body) { if(!error && response.statusCode == 200) { From 31cd3b5995b664d3b73105a130c4f1a6cadb2849 Mon Sep 17 00:00:00 2001 From: reality <tinmachin3@gmail.com> Date: Tue, 26 Mar 2013 09:05:39 +0000 Subject: [PATCH 6/8] Given quotes its own error view to solve [#288] --- views/quotes/error.jade | 1 + 1 file changed, 1 insertion(+) create mode 100644 views/quotes/error.jade diff --git a/views/quotes/error.jade b/views/quotes/error.jade new file mode 100644 index 0000000..f78f6ae --- /dev/null +++ b/views/quotes/error.jade @@ -0,0 +1 @@ +p #{message} From 3c225defee9073ca138da40bdee045ce13e04e09 Mon Sep 17 00:00:00 2001 From: reality <tinmachin3@gmail.com> Date: Tue, 26 Mar 2013 18:43:55 +0100 Subject: [PATCH 7/8] stop telling people to fuck off --- modules/link/link.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/link/link.js b/modules/link/link.js index b6fa9f4..fe19117 100644 --- a/modules/link/link.js +++ b/modules/link/link.js @@ -27,7 +27,6 @@ var link = function(dbot) { size += chunk.length; if(size > limit) { page.abort(); - event.reply('request too big, fuck off'); } }); }; From 141cab407d12b1e0ac987dd632e54d6a01be65e1 Mon Sep 17 00:00:00 2001 From: Matt Molyneaux <moggers87+git@moggers87.co.uk> Date: Thu, 28 Mar 2013 21:20:41 +0000 Subject: [PATCH 8/8] Remove ^A from ctcp actions I'll have my pony now. --- modules/spelling/spelling.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/spelling/spelling.js b/modules/spelling/spelling.js index 5078e29..cf574c9 100644 --- a/modules/spelling/spelling.js +++ b/modules/spelling/spelling.js @@ -99,6 +99,7 @@ var spelling = function(dbot) { var fix = this.last[event.channel.name][candidate].replace(winner, correction); if (/^.ACTION/.test(fix)) { fix = fix.replace(/^.ACTION/, '/me'); + fix = fix.replace("\x01", ''); } this.last[event.channel.name][candidate] = fix; var output = {