Created
March 11, 2011 02:37
-
-
Save mndrix/865363 to your computer and use it in GitHub Desktop.
Support ;;gpg info --key CE52C98A48081991
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/GPG/plugin.py b/GPG/plugin.py | |
index 171d876..cfd4482 100644 | |
--- a/GPG/plugin.py | |
+++ b/GPG/plugin.py | |
@@ -333,19 +333,27 @@ class GPG(callbacks.Plugin): | |
irc.reply(response + "not identified.") | |
ident = wrap(ident, [optional('something')]) | |
- def info(self, irc, msg, args, nick): | |
- """<nick> | |
- | |
+ def info(self, irc, msg, args, optlist, nick): | |
+ """[--key] <nick> | |
+ | |
Returns the registration details of registered user <nick>. | |
+ If '--key' option is given, interpret <nick> as a GPG key ID. | |
""" | |
- result = self.db.getByNick(nick) | |
+ key = False | |
+ for (option, arg) in optlist: | |
+ if option == 'key': | |
+ key = True | |
+ if key: | |
+ result = self.db.getByKey(nick) | |
+ else: | |
+ result = self.db.getByNick(nick) | |
if len(result) == 0: | |
irc.error("No such user registered.") | |
return | |
result = result[0] | |
irc.reply("User '%s', with keyid %s and fingerprint %s, registered on %s." %\ | |
(result[4], result[1], result[2], time.ctime(result[3]))) | |
- info = wrap(info, ['something']) | |
+ info = wrap(info, [getopts({'key': '',}),'something']) | |
def stats(self, irc, msg, args): | |
"""takes no arguments |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment