[cl-irc-devel] [patch] Add a connection arg to irc-message-event
Andreas Fuchs
asf at boinkor.net
Fri Jan 27 19:11:11 UTC 2006
Hi,
Beirc as it is right now uses a really ugly re-implementation of the
read-message method, because in order to operate correctly, we can't
just use an :around method on read-message like this:
(defmethod read-message ((con my-irc-connection))
(let ((m (call-next-method)))
(dispatch-on-message m)
m))
Why? Because (in the case of a QUIT message) read-message modified the
channel user table already when beirc tries to find out which channels
a user who just quit was on.
So, I think we're specializing a method one level too high. We should
be specializing the irc-message-event method, but it has no connection
argument. Yet.
The attached patch adds a connection argument on which
irc-message-event can be specialized. I would also suggest exporting
irc-message-event and making that method the recommended way to
dispatch on all messages on an irc connection.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ,message-event-connection-arg.patch
Type: application/octet-stream
Size: 2360 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-irc-devel/attachments/20060127/652b22f3/attachment.obj>
-------------- next part --------------
I've used this patch with a locally hacked version of beirc for a few
days now and it works very well for me. I hope you all like it,
because I'd really like to see that ugly wart in beirc go away. (-:
--
Andreas Fuchs, (http://|im:asf@|mailto:asf@)boinkor.net, antifuchs
More information about the cl-irc-devel
mailing list