* riece-filter.el (riece-sentinel): Don't clear
[riece] / lisp / riece-display.el
index bb49009..6dcec6a 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
@@ -87,8 +85,7 @@
                  (put-text-property point (point) 'riece-identity
                                     (car channels))))
            (setq index (1+ index)
-                 channels (cdr channels))))
-       (setq riece-channel-list-changed nil))))
+                 channels (cdr channels)))))))
 
 (defun riece-update-channel-indicator ()
   (setq riece-channel-indicator
       (setq riece-channel-buffer (get-buffer (riece-channel-buffer-name
                                              riece-current-channel))))
   (run-hooks 'riece-update-buffer-functions)
+  (setq riece-channel-list-changed nil)
   (force-mode-line-update t))
 
 (defun riece-channel-buffer-name (identity)
     (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)))