Skip to content

Commit

Permalink
mammon.ext.misc.kline: Just use quit instead of exit_client, fixes ma…
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielOaks committed Dec 21, 2015
1 parent ea9786b commit 4e735a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
14 changes: 4 additions & 10 deletions mammon/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,20 +329,14 @@ def kill(self, source, reason):
self.dump_message(m)
self.quit('Killed ({source} ({reason}))'.format(source=source.nickname, reason=reason))

def quit(self, message):
eventmgr_core.dispatch('client quit', {
'client': self,
'message': message,
})

m = RFC1459Message.from_data('QUIT', source=self, params=[message])
self.sendto_common_peers(m)
self.exit()
def quit(self, message, comment=None):
if comment is None:
comment = message

def exit_client(self, message, comment):
eventmgr_core.dispatch('client quit', {
'client': self,
'message': message,
'comment': comment,
})

m = RFC1459Message.from_data('QUIT', source=self.hostmask, params=[message])
Expand Down
4 changes: 2 additions & 2 deletions mammon/ext/misc/kline.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def check_dline(cli, info):
shown = 'D-Lined'
if info['duration_mins']:
shown += ' ({} mins)'.format(info['duration_mins'])
cli.exit_client('Closed Connection', shown)
cli.quit('Closed Connection', shown)

def check_kline(cli, info):
if not ircmatch.match(ircmatch.ascii, info['user'], cli.username):
Expand All @@ -129,7 +129,7 @@ def check_kline(cli, info):
shown = 'K-Lined'
if info['duration_mins']:
shown += ' ({} mins)'.format(info['duration_mins'])
cli.exit_client('Closed Connection', shown)
cli.quit('Closed Connection', shown)

# - - - COMMANDS - - -

Expand Down

0 comments on commit 4e735a4

Please sign in to comment.