From: Steve Youngs Date: Fri, 4 Apr 2014 07:35:57 +0000 (+1000) Subject: Fix hiding of join/part/quit messages. X-Git-Url: http://cgit.sxemacs.org/?p=riece;a=commitdiff_plain;h=d09bb7c2c7dda77ae59abc81e8d2aaa94909e9b6 Fix hiding of join/part/quit messages. As it turns out, if you hide your own joins, parts, and quits, Riece gets really confused about what channels you're on and wouldn't update the channel list. This changeset fixes that by not hiding the user's joins, parts, or quits. The variable controlling it was also renamed to something nicer. ERC uses `erc-hide-list' for this, so `riece-hide-list' seems a good fit. * lisp/riece-options.el (riece-hide-list): Renamed from `riece-hide-joins-parts-quits' which was way too ugly. * riece-handle.el (riece-handle-join-message): Use renamed hide var, don't hide our own joins. (riece-handle-part-message): Use renamed hide var, don't hide our own parts. (riece-handle-quit-message): Use renamed hide var, don't hide our own quits. Signed-off-by: Steve Youngs --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index de00866..e1004e7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2014-04-04 Steve Youngs + + * riece-options.el (riece-hide-list): Renamed from + `riece-hide-joins-parts-quits' which was an ugly name. + + * riece-handle.el (riece-handle-join-message): Use renamed hide + var, don't hide our own joins. + (riece-handle-part-message): Use renamed hide var, don't hide our + own parts. + (riece-handle-quit-message): Use renamed hide var, don't hide our + own quits. + 2014-04-01 Steve Youngs * riece-options.el (riece-hide-joins-parts-quits): New user diff --git a/lisp/riece-handle.el b/lisp/riece-handle.el index cb1e2d3..e29f59d 100644 --- a/lisp/riece-handle.el +++ b/lisp/riece-handle.el @@ -141,7 +141,9 @@ (if (and riece-gather-channel-modes (riece-identity-equal-no-server user riece-real-nickname)) (riece-send-string (format "MODE %s\r\n" (car channels)))) - (unless (memq 'joins riece-hide-joins-parts-quits) + (unless (and (memq 'joins riece-hide-list) + (not (riece-identity-equal-no-server + user riece-real-nickname))) (let* ((channel-identity (riece-make-identity (car channels) riece-server-name)) (buffer (riece-channel-buffer channel-identity))) @@ -166,13 +168,15 @@ (setq channels (cdr channels))))) (defun riece-handle-part-message (prefix decoded) - (unless (memq 'parts riece-hide-joins-parts-quits) - (let* ((user (riece-prefix-nickname prefix)) - (parameters (riece-split-parameters (riece-decoded-string decoded))) - ;; RFC2812 3.2.2 doesn't recommend server to send part - ;; messages which contain multiple targets. - (channels (split-string (car parameters) ",")) - (user-identity (riece-make-identity user riece-server-name))) + (let* ((user (riece-prefix-nickname prefix)) + (parameters (riece-split-parameters (riece-decoded-string decoded))) + ;; RFC2812 3.2.2 doesn't recommend server to send part + ;; messages which contain multiple targets. + (channels (split-string (car parameters) ",")) + (user-identity (riece-make-identity user riece-server-name))) + (unless (and (memq 'parts riece-hide-list) + (not (riece-identity-equal-no-server + user riece-real-nickname))) (while channels (let* ((channel-identity (riece-make-identity (car channels) riece-server-name)) @@ -261,7 +265,9 @@ (while pointer (riece-naming-assert-part user (car pointer)) (setq pointer (cdr pointer))) - (unless (memq 'quits riece-hide-joins-parts-quits) + (unless (and (memq 'quits riece-hide-list) + (not (riece-identity-equal-no-server + user riece-real-nickname))) (let ((buffers (delq nil (mapcar (lambda (channel) diff --git a/lisp/riece-options.el b/lisp/riece-options.el index b6e41a8..f468a39 100644 --- a/lisp/riece-options.el +++ b/lisp/riece-options.el @@ -364,10 +364,11 @@ specifying the coding systems for decoding and encoding respectively." :type 'function :group 'riece-options) -(defcustom riece-hide-joins-parts-quits '() - "Whether to hide join/part/quit messages. +(defcustom riece-hide-list '() + "Whether to hide certain server messages. -This should be a list of up to 3 symbols, namely: `joins', `parts', +Currently supported are join, part, and quit messages. +This is a list of up to 3 symbols, namely: `joins', `parts', `quits'." :type '(set (symbol :tag "Hide Joins" joins) (symbol :tag "Hide Parts" parts)