* riece-guess.el (riece-guess-channel-try-functions): Default to
[riece] / lisp / riece-display.el
index bb49009..8ddf882 100644 (file)
@@ -29,8 +29,6 @@
 (require 'riece-misc)
 (require 'riece-layout)
 
-(autoload 'ring-insert "ring")
-
 (defvar riece-update-buffer-functions
   '(riece-update-user-list-buffer
     riece-update-channel-list-buffer
     (current-buffer)))
 
 (defun riece-switch-to-channel (identity)
-  (ring-insert riece-channel-history riece-current-channel)
-  (setq riece-current-channel identity)
-  (run-hooks 'riece-channel-switch-hook))
+  (let ((last riece-current-channel))
+    (setq riece-current-channel identity)
+    (run-hook-with-args 'riece-after-switch-to-channel-functions last)))
 
 (defun riece-join-channel (identity)
   (unless (riece-identity-member identity riece-current-channels)
       (setq identity (car pointer)))
     (if identity
        (riece-switch-to-channel identity)
-      (ring-insert riece-channel-history riece-current-channel)
-      (setq riece-current-channel nil))))
+      (let ((last riece-current-channel))
+       (run-hook-with-args 'riece-after-switch-to-channel-functions last)
+       (setq riece-current-channel nil)))))
 
 (defun riece-part-channel (identity)
   (let ((pointer (riece-identity-member identity riece-current-channels)))