From: Kevin M. Rosenberg Date: Sun, 4 Jan 2004 00:09:49 +0000 (+0000) Subject: r8476: improve kick handling X-Git-Tag: v0.9.3~35 X-Git-Url: http://git.kpe.io/?p=irc-logger.git;a=commitdiff_plain;h=fad9546c062d76fec1d69d421d6e2b928458e2b8 r8476: improve kick handling --- diff --git a/logger.lisp b/logger.lisp index 15080c1..3c04c38 100644 --- a/logger.lisp +++ b/logger.lisp @@ -242,10 +242,12 @@ o;;; -*- Mode: Lisp -*- (defmethod %output-event ((format (eql :sexp)) stream utime type channel source text msg unichannel) - (if unichannel - (format stream "(~S ~S ~S ~S ~S)~%" utime type source text (last-sexp-field type msg)) - (format stream "(~S ~S ~S ~S ~S ~S)~%" utime type source channel text - (last-sexp-field type msg)))) + (let ((*print-circle* nil) + (*print-pretty* nil)) + (if unichannel + (format stream "(~S ~S ~S ~S ~S)~%" utime type source text (last-sexp-field type msg)) + (format stream "(~S ~S ~S ~S ~S ~S)~%" utime type source channel text + (last-sexp-field type msg))))) (defmethod %output-event ((format (eql :text)) stream utime type channel source text msg unichannel) @@ -356,7 +358,14 @@ o;;; -*- Mode: Lisp -*- (output-event msg :join (trailing-argument msg))) (defun kick-hook (msg) - (output-event msg :kick (first (arguments msg)))) + (let ((logger (find-logger-with-connection (connection msg))) + (channel (first (arguments msg))) + (who-kicked (second (arguments msg)))) + (when (string-equal (nickname logger) who-kicked) + (warn "*** Logging daemon ~A has been kicked from ~A at ~A" (nickname logger) + channel (format-date-time (received-time msg))) + #+ignore (remove-channel-logger logger channel)) + (output-event msg :kick channel who-kicked))) (defun notice-hook (msg) (if (and (string-equal (source msg) "NickServ") @@ -370,7 +379,7 @@ o;;; -*- Mode: Lisp -*- (defun ping-hook (msg) (let ((logger (find-logger-with-connection (connection msg)))) (pong (connection msg) (server logger)) - (format *standard-output* "Sending pong to ~A~%" (server logger)))) + #+debug (format *standard-output* "Sending pong to ~A~%" (server logger)))) (defun pong-hook (msg) (let ((logger (find-logger-with-connection (connection msg))))