Fix -- user list buffer not updating when parts are hidden.
[riece] / lisp / riece-xface.el
index 7e4bb78..391490a 100644 (file)
@@ -1,4 +1,4 @@
-;;; riece-xface.el --- display X-Face in IRC buffers
+;;; riece-xface.el --- display X-Face in IRC buffers -*- lexical-binding: t -*-
 ;; Copyright (C) 1998-2003 Daiki Ueno
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
@@ -19,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -31,9 +31,7 @@
 (require 'riece-identity)
 (require 'riece-globals)
 (require 'riece-display)
-(eval-when-compile (require 'riece-lsdb))
-
-(defvar riece-xface-enabled nil)
+(require 'riece-lsdb)
 
 (defconst riece-xface-description
   "Display X-Face in IRC buffers.")
@@ -41,7 +39,7 @@
 (defvar lsdb-insert-x-face-function)
 
 (defun riece-xface-update-user-list-buffer ()
-  (if riece-xface-enabled
+  (if (get 'riece-xface 'riece-addon-enabled)
       (riece-scan-property-region
        'riece-identity (point-min)(point-max)
        (lambda (start end)
               'riece-xface-user-list-mode-hook))
 
 (defun riece-xface-enable ()
-  (setq riece-xface-enabled t)
   (if riece-current-channel
       (riece-emit-signal 'user-list-changed riece-current-channel)))
 
 (defun riece-xface-disable ()
-  (setq riece-xface-enabled nil)
   (if riece-current-channel
       (riece-emit-signal 'user-list-changed riece-current-channel)))