From 1a73603e228d38abab29fbac47b677e2b6f3692d Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sat, 23 Oct 2004 20:54:28 +0000 Subject: [PATCH] Added httpUrl converter. --- src/commands.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/commands.py b/src/commands.py index c694c8fd0..c1a413527 100644 --- a/src/commands.py +++ b/src/commands.py @@ -434,6 +434,12 @@ def getUrl(irc, msg, args, state): else: irc.errorInvalid('url', args[0]) +def getHttpUrl(irc, msg, args, state): + if webutils.urlRe.match(args[0]) and args[0].startswith('http://'): + state.args.append(args.pop(0)) + else: + irc.errorInvalid('http url', args[0]) + def getNow(irc, msg, args, state): state.args.append(int(time.time())) @@ -494,6 +500,7 @@ wrappers = ircutils.IrcDict({ 'color': getIrcColor, 'now': getNow, 'url': getUrl, + 'httpUrl': getHttpUrl, 'float': getFloat, 'nonInt': getNonInt, 'positiveInt': getPositiveInt,