Skip to content

Commit

Permalink
admin comment update and message change
Browse files Browse the repository at this point in the history
_do_modederquest docstring updated to clarify the difference between it
and _do_moderequest.

Message sent when doing a !mode with a duration is now sent via direct
notice.
  • Loading branch information
brownan committed Nov 8, 2014
1 parent ba81027 commit ed68168
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions abbott/plugins/admin.py
Expand Up @@ -252,7 +252,7 @@ def start(self):
argmatch = "(?P<nick>[^ ]+)( (?P<reason>.*))?$",
permission="irc.op.kick",
callback=self.kick,
deniedcallback=self.kickself,
#deniedcallback=self.kickself,
helptext="Kicks a user from the current channel")

# Op commands
Expand Down Expand Up @@ -302,7 +302,7 @@ def start(self):
argmatch = "(?P<nick>[^ ]+)(?: (?P<timestr>.+))?$",
permission="irc.op.quiet",
callback=self.quiet,
deniedcallback=self.quietself,
#deniedcallback=self.quietself,
helptext="Quiets a user."
)

Expand Down Expand Up @@ -921,7 +921,15 @@ def unban(self, event, match):

def _do_modederequest(self, channel, mode, hostmask, delay):
"""Note the *de* in _do_mode*de*request.
For info see _do_moderequest()"""
For info see _do_moderequest()
Difference between this method and _do_moderequest: do_moderequest
takes a *duration*; it always applies the requested mode and then
un-does that after the duration.
This method on the other hand takes a *delay*; it always applies the
requested mode but may wait to do so.
"""
if delay:
self._set_timer(delay, hostmask, channel, "-"+mode)
return defer.succeed(None)
Expand Down Expand Up @@ -982,7 +990,7 @@ def mode(self, event, match):
event.reply(u"Doing a {0}{1} {2}".format(
reversemode, u" "+param if param else "",
pretty.date(int(time.time()+time_to_wait))
))
), direct=True, notice=True)

@require_channel
@defer.inlineCallbacks
Expand Down
2 changes: 1 addition & 1 deletion abbott/plugins/useful.py
Expand Up @@ -126,7 +126,7 @@ def connectionMade(self):
self.timer = reactor.callLater(self.timeout, self.timed_out)

def outReceived(self, data):
self.output.write(data)
self.output.write(data.decode("UTF-8"))
def errReceived(self, data):
if self.capstderr:
self.output.write(data)
Expand Down

0 comments on commit ed68168

Please sign in to comment.