[cl-irc-cvs] r186 - trunk
ehuelsmann at common-lisp.net
ehuelsmann at common-lisp.net
Sat Apr 21 21:02:06 UTC 2007
Author: ehuelsmann
Date: Sat Apr 21 17:02:06 2007
New Revision: 186
Modified:
trunk/event.lisp
trunk/protocol.lisp
Log:
Silence UNHANDLED messages on the debug stream when they are in fact handled.
Modified: trunk/event.lisp
==============================================================================
--- trunk/event.lisp (original)
+++ trunk/event.lisp Sat Apr 21 17:02:06 2007
@@ -12,8 +12,8 @@
(defmethod irc-message-event (connection (message irc-message))
(declare (ignore connection))
- (apply-to-hooks message)
- (client-log (connection message) message "UNHANDLED-EVENT:"))
+ (unless (apply-to-hooks message)
+ (client-log (connection message) message "UNHANDLED-EVENT:")))
(defgeneric default-hook (message)
Modified: trunk/protocol.lisp
==============================================================================
--- trunk/protocol.lisp (original)
+++ trunk/protocol.lisp Sat Apr 21 17:02:06 2007
@@ -993,10 +993,17 @@
(car (last (arguments message))))
(force-output stream)))
+
(defmethod apply-to-hooks ((message irc-message))
- (let ((connection (connection message)))
- (dolist (hook (get-hooks connection (class-name (class-of message))))
- (funcall hook message))))
+ "Applies any applicable hooks to `message'.
+
+Returns non-nil if any of the hooks do."
+ (let ((connection (connection message))
+ (result nil))
+ (dolist (hook (get-hooks connection (class-name (class-of message)))
+ result)
+ (setf result (or (funcall hook message)
+ result)))))
;;
;; CTCP Message
More information about the cl-irc-cvs
mailing list