From 61eb55fa577bb57ab2b11910f56ea2715e166dd6 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 4 Jan 2004 09:57:33 +0000 Subject: [PATCH] Added checking for ops and actually being in the channel to getops. --- plugins/Services.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/Services.py b/plugins/Services.py index 833a14434..e1104972e 100644 --- a/plugins/Services.py +++ b/plugins/Services.py @@ -171,7 +171,13 @@ class Services(privmsgs.CapabilityCheckingPrivmsg): given, the current channel is assumed. """ channel = privmsgs.getChannel(msg, args) - irc.sendMsg(ircmsgs.privmsg(self.chanserv, 'op %s' % channel)) + try: + if irc.nick in irc.state.channels[channel].ops: + irc.error(msg, 'I\'ve already got ops in %sx' % channel) + else: + irc.sendMsg(ircmsgs.privmsg(self.chanserv, 'op %s' % channel)) + except KeyError: + irc.error(msg, 'I\'m not in %s.' % channel) def identify(self, irc, msg, args): """takes no arguments