Skip to content

Instantly share code, notes, and snippets.

@qdot
Created March 30, 2015 23:02
Show Gist options
  • Save qdot/6f83b7d3bd2fca9a1f6c to your computer and use it in GitHub Desktop.
Save qdot/6f83b7d3bd2fca9a1f6c to your computer and use it in GitHub Desktop.
buffer local erc-hide-list
(defvar qdot/erc-status-allow-list nil
"alist of channels and the event messages to show for them.")
(setq qdot/erc-status-allow-list
'(("&bitlbee" . ("PART" "JOIN" "MODE" "NICK" "QUIT"))
("znc-bitlbee" . ("PART" "JOIN" "MODE" "NICK" "QUIT"))))
(defadvice erc-hide-current-message-p (around qdot/erc-hide-per-buffer-advice last (parsed) activate)
"Addition to hide message predicate to check for channel
specific or network specific join/part showing. PART/JOIN/MODE
messages can be parsed per channel. NICK/QUIT are parsed per
network."
(let* ((command (erc-response.command parsed))
(command-args (erc-response.command-args parsed))
(sender (car (erc-parse-user (erc-response.sender parsed))))
(channel (if (member command '("PART" "JOIN" "MODE"))
(car command-args)
(buffer-name (current-buffer)))))
(if (and (assoc channel qdot/erc-status-allow-list)
(member command (assoc channel qdot/erc-status-allow-list)))
nil
ad-do-it)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment