X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=logger.lisp;h=065effa485c76bd7be8931ae2f7fa2b2bb336d36;hb=097d28989cb7d3e3c824212e1ddeeb8d6a2a3f39;hp=9a4b8f1b7bb3d82690a7bbe8c9a4d1330694e587;hpb=6c1474d89e0dd6f5bf561fb70aaf0ba0929e6176;p=irc-logger.git diff --git a/logger.lisp b/logger.lisp index 9a4b8f1..065effa 100644 --- a/logger.lisp +++ b/logger.lisp @@ -9,7 +9,7 @@ (defvar *daemon-monitor-process* nil "Process of background monitor.") (defparameter *timeout* 60) -(defclass channel () +(defclass log-channel () ((name :initarg :name :reader c-name :documentation "Name of channel.") (streams :initarg :streams :reader streams @@ -396,9 +396,13 @@ (output-event msg :privmsg channel (trailing-argument msg)))))) (defun action-hook (msg) - (output-event msg :action (first (arguments msg)) - (subseq (trailing-argument msg) 8 - (- (length (trailing-argument msg)) 1)))) + (let ((end (- (length (trailing-argument msg)) 1))) + ;; end has been as low as 7 + (when (< end 8) + (warn "End is less than 8: `$A'." msg)) + (output-event msg :action (first (arguments msg)) + (subseq (trailing-argument msg) (min 8 end) + (- (length (trailing-argument msg)) 1))))) (defun nick-hook (msg) (output-event msg :nick nil (trailing-argument msg))) @@ -484,7 +488,7 @@ (defun make-a-channel (name formats output) - (make-instance 'channel + (make-instance 'log-channel :name name :streams (make-array (length formats) :initial-element nil) :output-root (when (and (pathnamep output) @@ -718,7 +722,8 @@ (let ((text (trailing-argument msg)) (logger (find-logger-with-connection (connection msg)))) (when (and (stringp text) - (zerop (search (format nil "Closing Link: ~A" (l-nickname logger)) text))) + (eql 0 (search (format nil "Closing Link: ~A" + (l-nickname logger)) text))) (setf (warning-message-utime logger) (received-time msg))) (output-event msg :error nil (trailing-argument msg))))