* riece-user.el (riece-rename-user): Don't modify entry when
authorueno <ueno>
Sun, 1 Jun 2003 20:46:47 +0000 (20:46 +0000)
committerueno <ueno>
Sun, 1 Jun 2003 20:46:47 +0000 (20:46 +0000)
old-name == new-name.

lisp/ChangeLog
lisp/riece-user.el

index b1af093..678c6f3 100644 (file)
@@ -1,5 +1,8 @@
 2003-06-01  Daiki Ueno  <ueno@unixuser.org>
 
+       * riece-user.el (riece-rename-user): Don't modify entry when
+       old-name == new-name.
+
        * riece-display.el (riece-configure-windows): Use window-buffer
        instead of current-buffer.
 
index 28d061c..f74f770 100644 (file)
 
 (defun riece-rename-user (old-name new-name)
   (riece-with-server-buffer
-   (let ((symbol (intern-soft (downcase (riece-identity-prefix old-name))
-                             riece-obarray)))
-     (when symbol
-       (set (intern (downcase (riece-identity-prefix new-name))
-                   riece-obarray)
-           (symbol-value symbol))
-       (makunbound symbol)
-       (unintern (symbol-name symbol) riece-obarray)))))
+   (unless (equal (downcase (riece-identity-prefix old-name))
+                 (downcase (riece-identity-prefix new-name)))
+     (let ((symbol (intern-soft (downcase (riece-identity-prefix old-name))
+                               riece-obarray)))
+       (when symbol
+        (set (intern (downcase (riece-identity-prefix new-name))
+                     riece-obarray)
+             (symbol-value symbol))
+        (makunbound symbol)
+        (unintern (symbol-name symbol) riece-obarray))))))
 
 (defun riece-make-user (&optional channels user-at-host modes away)
   "Make an instance of user object.