Function: erc-autojoin-add

erc-autojoin-add is a byte-compiled function defined in erc-join.el.gz.

Signature

(erc-autojoin-add PROC PARSED)

Documentation

Add the channel being joined to erc-autojoin-channels-alist.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-join.el.gz
(defun erc-autojoin-add (proc parsed)
  "Add the channel being joined to `erc-autojoin-channels-alist'."
  (let* ((chnl (erc-response.contents parsed))
	 (nick (car (erc-parse-user (erc-response.sender parsed))))
	 (server (with-current-buffer (process-buffer proc)
		   (erc-autojoin-current-server))))
    (when (erc-current-nick-p nick)
      (let ((elem (or (assoc (erc-network) erc-autojoin-channels-alist)
		      (assoc server erc-autojoin-channels-alist))))
	(if elem
	    (unless (member chnl (cdr elem))
	      (setcdr elem (cons chnl (cdr elem))))
	  ;; This always keys on server, not network -- user can
	  ;; override by simply adding a network to
	  ;; `erc-autojoin-channels-alist'
	  (setq erc-autojoin-channels-alist
		(cons (list server chnl)
		      erc-autojoin-channels-alist))))))
  ;; We must return nil to tell ERC to continue running the other
  ;; functions.
  nil)