   (visual-line-mode)
   (adaptive-wrap-prefix-mode))
 
-(defun pjones:erc-join-hook ()
-  "Hook run after a channel join."
-  ;; Automatically ignore IRC channels.
+(defun pjones:erc-ignore-channel ()
+  "Disable ERC tracking for channels."
   (when (and (erc-default-target)
              (string-match-p "^#" (erc-default-target)))
     (add-to-list 'erc-track-exclude (erc-default-target))))
 
-(add-hook 'erc-mode-hook   #'pjones:erc-mode-hook)
-(add-hook 'erc-join-buffer #'pjones:erc-join-hook)
+(add-hook 'erc-mode-hook #'pjones:erc-mode-hook)
+(add-hook 'erc-track-mode-hook #'pjones:erc-ignore-channel)
 
 ;;; erc-conf.el ends here

                 stamp
                 track
                 truncate)))

(defun pjones:erc-connect (username)
  "Connect to an IRC network via ERC with USERNAME."

;;; Code:
;; Dependencies:
(require 'erc)
(require 'erc-track)
(require 'passmm)
(require 'adaptive-wrap)

