     (pjones:urgency-hint (selected-frame) t)
     (circe-notifications-notify nick body channel)))
 
+(defun pjones:ignore-buffer (&optional name)
+  "Start ignoring the buffer with NAME or the current buffer."
+  (interactive)
+  (let ((buf (or name (buffer-name))))
+    (add-to-list 'pjones-ignored-buffers buf)))
+
+(defun pjones:track-buffer (&optional name)
+  "Start tracking the buffer with NAME or the current buffer."
+  (interactive)
+  (let ((buf (or name (buffer-name))))
+    (setq pjones-ignored-buffers
+          (remove buf 'pjones-ignored-buffers))))
+
+(defun pjones:ignored-buffer-p (name)
+  "Returns non-nil if NAME is being ignored."
+  (member name pjones-ignored-buffers))
+
 (defun pjones:circe-chat-mode-hook ()
   "Configure circe-mode."
   (tracking-mode)
 
   (let ((map circe-chat-mode-map))
-    (define-key map (kbd "C-c C-q") 'circe-command-QUERY)))
+    (define-key map (kbd "C-c C-q") 'circe-command-QUERY)
+    (define-key map (kbd "C-c C-t") 'pjones:track-buffer)
+    (define-key map (kbd "C-c C-i") 'pjones:ignore-buffer)))
+
+(defun pjones:circe-channel-mode-hook ()
+  "Configure circe-channel-mode."
+  (pjones:ignore-buffer))
 
 (defun pjones:lui-mode-hook ()
   "Configure lui-mode."

  ;; Disable fringe indicators:
  (setf (cdr (assoc 'continuation fringe-indicator-alist)) nil))


(add-hook 'circe-chat-mode-hook 'pjones:circe-chat-mode-hook)
(add-hook 'lui-mode-hook 'pjones:lui-mode-hook)
(add-hook 'circe-server-connected-hook 'enable-circe-notifications)

;###############################################################################
;;; Stolen code below.....

(defadvice circe-command-SAY (after jjf-circe-unignore-target)
  (let ((ignored (tracking-ignored-p (current-buffer) nil)))
    (when ignored
      (setq tracking-ignored-buffers
            (remove ignored tracking-ignored-buffers))
      (message "This buffer will now be tracked."))))

(ad-activate 'circe-command-SAY)

;; Taken from: https://github.com/jorgenschaefer/circe/wiki/Configuration
(defun circe-network-connected-p (network)

(defvar pjones-irc-password nil
  "My password for connecting to ZNC.")

(defvar pjones-ignored-buffers nil
  "List of buffer names that are ignored for IRC tracking.")

;; Load passwords from a private file
(load "~/keys/emacs/secrets.el")

