Support Scandinavian alphabets, described in RFC2812, 2.2.
authorueno <ueno>
Tue, 3 Jun 2003 07:00:54 +0000 (07:00 +0000)
committerueno <ueno>
Tue, 3 Jun 2003 07:00:54 +0000 (07:00 +0000)
* riece-inlines.el (scandinavian-downcase): New inline function.
(scandinavian-equal-ignore-case): Rename from
string-equal-ignore-case.
(scandinavian-member-ignore-case): Rename from
string-list-member-ignore-case.

* riece-identity.el (riece-identity-equal): Rename from
riece-identity-equal-no-server; use scandinavian-equal-ignore-case.
(riece-identity-equal-safe): Rename from riece-identity-equal.
(riece-identity-member): Rename from riece-identity-member-no-server.
(riece-identity-member-safe): Rename from riece-identity-member.
(riece-identity-assoc): Rename from riece-identity-assoc-no-server.
(riece-identity-assoc-safe): Rename from riece-identity-assoc.

14 files changed:
lisp/ChangeLog
lisp/riece-300.el
lisp/riece-channel.el
lisp/riece-commands.el
lisp/riece-ctcp.el
lisp/riece-display.el
lisp/riece-handle.el
lisp/riece-identity.el
lisp/riece-inlines.el
lisp/riece-message.el
lisp/riece-naming.el
lisp/riece-ndcc.el
lisp/riece-rdcc.el
lisp/riece-user.el

index 9b4084a..9155fba 100644 (file)
@@ -1,5 +1,21 @@
 2003-06-03  Daiki Ueno  <ueno@unixuser.org>
 
+       * riece-inlines.el (scandinavian-downcase): New inline function.
+       (scandinavian-equal-ignore-case): Rename from
+       string-equal-ignore-case.
+       (scandinavian-member-ignore-case): Rename from
+       string-list-member-ignore-case.
+
+       * riece-identity.el (riece-identity-equal): Rename from
+       riece-identity-equal-no-server; use scandinavian-equal-ignore-case.
+       (riece-identity-equal-safe): Rename from riece-identity-equal.
+       (riece-identity-member): Rename from riece-identity-member-no-server.
+       (riece-identity-member-safe): Rename from riece-identity-member.
+       (riece-identity-assoc): Rename from riece-identity-assoc-no-server.
+       (riece-identity-assoc-safe): Rename from riece-identity-assoc.
+
+2003-06-03  Daiki Ueno  <ueno@unixuser.org>
+
        * riece-rdcc.el: Require 'riece-ctcp.
        (riece-rdcc-insinuate): Add "DCC" to
        riece-ctcp-additional-clientinfo.
index 7e2b58c..f52881b 100644 (file)
       (let* ((channel (match-string 1 string))
             (visible (match-string 2 string))
             (topic (substring string (match-end 0))))
-       (let ((buffer (cdr (riece-identity-assoc-no-server
+       (let ((buffer (cdr (riece-identity-assoc
                            (riece-make-identity channel)
                            riece-channel-buffer-alist))))
          (riece-insert-info buffer (concat visible " users, topic: "
        (while modes
          (riece-channel-toggle-mode channel (car modes) (eq toggle ?+))
          (setq modes (cdr modes)))
-       (let ((buffer (cdr (riece-identity-assoc-no-server
+       (let ((buffer (cdr (riece-identity-assoc
                            (riece-make-identity channel)
                            riece-channel-buffer-alist))))
          (riece-insert-info buffer (concat "Mode: " mode-string "\n"))
   (if (string-match "^\\([^ ]+\\) :" string)
       (let* ((channel (match-string 1 string))
             (message (substring string (match-end 0)))
-            (buffer (cdr (riece-identity-assoc-no-server
+            (buffer (cdr (riece-identity-assoc
                           (riece-make-identity channel)
                           riece-channel-buffer-alist))))
        (if remove
   (if (string-match "^\\([^ ]+\\) " string)
       (let* ((channel (match-string 1 string))
             (user (substring string (match-end 0)))
-            (buffer (cdr (riece-identity-assoc-no-server
+            (buffer (cdr (riece-identity-assoc
                           (riece-make-identity channel)
                           riece-channel-buffer-alist))))
        (riece-insert-info buffer (concat "Inviting " user "\n"))
             (flag (match-string 8 string))
             (hops (match-string 9 string))
             (name (substring string (match-end 0)))
-            (buffer (cdr (riece-identity-assoc-no-server
+            (buffer (cdr (riece-identity-assoc
                           (riece-make-identity channel)
                           riece-channel-buffer-alist))))
        (riece-naming-assert-join nick channel)
index b2cc8c5..0d32bdf 100644 (file)
@@ -24,7 +24,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'riece-inlines))   ;string-assoc-ignore-case, etc.
+(eval-when-compile (require 'riece-inlines))   ;scandinavian-downcase
 
 (require 'riece-options)
 (require 'riece-identity)
 (defun riece-find-channel (name)
   "Get a channel object named NAME from the server buffer."
   (riece-with-server-buffer
-   (let ((symbol (intern-soft (downcase (riece-identity-prefix name))
+   (let ((symbol (intern-soft (scandinavian-downcase
+                              (riece-identity-prefix name))
                              riece-obarray)))
      (if symbol
         (symbol-value symbol)))))
 
 (defun riece-forget-channel (name)
   (riece-with-server-buffer
-   (let ((symbol (intern-soft (downcase (riece-identity-prefix name)))))
+   (let ((symbol (intern-soft (scandinavian-downcase
+                              (riece-identity-prefix name)))))
      (when symbol
        (makunbound symbol)
        (unintern (symbol-name symbol) riece-obarray)))))
@@ -70,11 +72,13 @@ the channel key, respectively."
 
 (defun riece-get-channel (name)
   (riece-with-server-buffer
-   (let ((symbol (intern-soft (downcase (riece-identity-prefix name))
+   (let ((symbol (intern-soft (scandinavian-downcase
+                              (riece-identity-prefix name))
                              riece-obarray)))
      (if symbol
         (symbol-value symbol)
-       (set (intern (downcase (riece-identity-prefix name))
+       (set (intern (scandinavian-downcase
+                    (riece-identity-prefix name))
                    riece-obarray)
            (riece-make-channel))))))
 
index b237282..ed5dcbd 100644 (file)
@@ -73,7 +73,7 @@
   "Select the next channel."
   (interactive)
   (when (> (length riece-current-channels) 1)
-    (let ((pointer (cdr (string-list-member-ignore-case
+    (let ((pointer (cdr (scandinavian-member-ignore-case
                         riece-current-channel
                         riece-current-channels))))
       (while (and pointer
@@ -92,7 +92,7 @@
   "Select the previous channel."
   (interactive)
   (when (> (length riece-current-channels) 1)
-    (let ((pointer (string-list-member-ignore-case
+    (let ((pointer (scandinavian-member-ignore-case
                    riece-current-channel
                    riece-current-channels))
          (start riece-current-channels)
                                         (riece-identity-prefix target))))))
 
 (defun riece-command-join-partner (target)
-  (let ((pointer (riece-identity-member target riece-current-channels)))
+  (let ((pointer (riece-identity-member-safe target riece-current-channels)))
     (if pointer
        (riece-command-switch-to-channel (car pointer))
       (riece-join-channel target)
         (setq key
               (riece-read-passwd (format "Key for %s: " target))))
      (list target key)))
-  (let ((pointer (riece-identity-member target riece-current-channels)))
+  (let ((pointer (riece-identity-member-safe target riece-current-channels)))
     (if pointer
        (riece-command-switch-to-channel (car pointer))
       (if (riece-channel-p target)
              (riece-channel-p target))
         (setq message (read-string "Message: ")))
      (list target message)))
-  (if (riece-identity-member target riece-current-channels)
+  (if (riece-identity-member-safe target riece-current-channels)
       (if (riece-channel-p target)
          (riece-command-part-channel target message)
        (riece-part-channel target)
index b878347..1110ca2 100644 (file)
@@ -83,7 +83,7 @@
 
 (defun riece-handle-ctcp-version-request (prefix target string)
   (let ((buffer (if (riece-channel-p target)
-                   (cdr (riece-identity-assoc-no-server
+                   (cdr (riece-identity-assoc
                          (riece-make-identity target)
                          riece-channel-buffer-alist))))
        (user (riece-prefix-nickname prefix)))
 
 (defun riece-handle-ctcp-ping-request (prefix target string)
   (let ((buffer (if (riece-channel-p target)
-                   (cdr (riece-identity-assoc-no-server
+                   (cdr (riece-identity-assoc
                          (riece-make-identity target)
                          riece-channel-buffer-alist))))
        (user (riece-prefix-nickname prefix)))
 
 (defun riece-handle-ctcp-clientinfo-request (prefix target string)
   (let ((buffer (if (riece-channel-p target)
-                   (cdr (riece-identity-assoc-no-server
+                   (cdr (riece-identity-assoc
                          (riece-make-identity target)
                          riece-channel-buffer-alist))))
        (user (riece-prefix-nickname prefix)))
 
 (defun riece-handle-ctcp-action-request (prefix target string)
   (let ((buffer (if (riece-channel-p target)
-                   (cdr (riece-identity-assoc-no-server
+                   (cdr (riece-identity-assoc
                          (riece-make-identity target)
                          riece-channel-buffer-alist))))
        (user (riece-prefix-nickname prefix)))
   (riece-send-string (format "PRIVMSG %s :\1ACTION %s\1\r\n"
                             (riece-identity-prefix channel)
                             action))
-  (let ((buffer (cdr (riece-identity-assoc-no-server
+  (let ((buffer (cdr (riece-identity-assoc
                      (riece-make-identity channel)
                      riece-channel-buffer-alist))))
     (riece-insert-change
index 6da4df6..021ab0a 100644 (file)
   (setq riece-last-channel riece-current-channel
        riece-current-channel identity
        riece-channel-buffer
-       (cdr (riece-identity-assoc-no-server
+       (cdr (riece-identity-assoc
              identity riece-channel-buffer-alist))
        riece-user-list-buffer 
-       (cdr (riece-identity-assoc-no-server
+       (cdr (riece-identity-assoc
              identity riece-user-list-buffer-alist)))
   (run-hooks 'riece-channel-switch-hook))
 
 (defun riece-join-channel (channel-name)
   (let ((identity (riece-make-identity channel-name)))
-    (unless (riece-identity-member-no-server
+    (unless (riece-identity-member
             identity riece-current-channels)
       (setq riece-current-channels
            (riece-identity-assign-binding
             identity riece-current-channels
             riece-default-channel-binding)))
-    (unless (riece-identity-assoc-no-server
+    (unless (riece-identity-assoc
             identity riece-channel-buffer-alist)
       (let ((buffer (riece-channel-buffer-create identity)))
        (setq riece-channel-buffer-alist
              (cons (cons identity buffer)
                    riece-channel-buffer-alist))))
-    (unless (riece-identity-assoc-no-server
+    (unless (riece-identity-assoc
             identity riece-user-list-buffer-alist)
       (let ((buffer (riece-user-list-buffer-create identity)))
        (setq riece-user-list-buffer-alist
 
 (defun riece-part-channel (channel-name)
   (let* ((identity (riece-make-identity channel-name))
-        (pointer (riece-identity-member-no-server
+        (pointer (riece-identity-member
                   identity riece-current-channels)))
     (if pointer
        (setcar pointer nil))
-    ;;XXX
-    (if (riece-identity-equal-no-server identity riece-current-channel)
+    (if (riece-identity-equal identity riece-current-channel)
        (riece-switch-to-nearest-channel pointer))))
 
 (defun riece-configure-windows-predicate ()
index 6ff8d2f..05a2607 100644 (file)
   (let* ((old (riece-prefix-nickname prefix))
         (new (car (riece-split-parameters string)))
         (channels (riece-user-get-channels old))
-        (visible (riece-identity-member-no-server
-                  riece-current-channel channels)))
+        (visible (riece-identity-member riece-current-channel channels)))
     (riece-naming-assert-rename old new)
-    (let ((pointer (riece-identity-member-no-server
+    (let ((pointer (riece-identity-member
                    (riece-make-identity old)
                    riece-current-channels)))
       (when pointer
        (setcar pointer (riece-make-identity new))
-       (setcar (riece-identity-assoc-no-server (riece-make-identity old)
-                                               riece-channel-buffer-alist)
+       (setcar (riece-identity-assoc (riece-make-identity old)
+                                     riece-channel-buffer-alist)
                (riece-make-identity new))
-       (setcar (riece-identity-assoc-no-server (riece-make-identity old)
-                                               riece-user-list-buffer-alist)
+       (setcar (riece-identity-assoc (riece-make-identity old)
+                                     riece-user-list-buffer-alist)
                (riece-make-identity new))
-       (if (riece-identity-equal-no-server (riece-make-identity old)
-                                           riece-current-channel)
+       (if (riece-identity-equal (riece-make-identity old)
+                                 riece-current-channel)
            (riece-switch-to-channel (riece-make-identity new)))
        (setq channels (cons (riece-make-identity new) channels))))
     (riece-insert-change (mapcar
                          (lambda (channel)
-                           (cdr (riece-identity-assoc-no-server
+                           (cdr (riece-identity-assoc
                                  (riece-make-identity channel)
                                  riece-channel-buffer-alist)))
                          channels)
     (while channels
       (riece-naming-assert-join user (car channels))
       ;;XXX
-      (if (string-equal-ignore-case user riece-real-nickname)
+      (if (scandinavian-equal-ignore-case user riece-real-nickname)
          (riece-switch-to-channel (riece-make-identity (car channels))))
-      (let ((buffer (cdr (riece-identity-assoc-no-server
+      (let ((buffer (cdr (riece-identity-assoc
                          (riece-make-identity (car channels))
                          riece-channel-buffer-alist))))
        (riece-insert-change
         (message (nth 1 parameters)))
     (while channels
       (riece-naming-assert-part user (car channels))
-      (let ((buffer (cdr (riece-identity-assoc-no-server
+      (let ((buffer (cdr (riece-identity-assoc
                          (riece-make-identity (car channels))
                          riece-channel-buffer-alist))))
        (riece-insert-change
         (user (nth 1 parameters))
         (message (nth 2 parameters)))
     (riece-naming-assert-part user channel)
-    (let ((buffer (cdr (riece-identity-assoc-no-server
+    (let ((buffer (cdr (riece-identity-assoc
                        (riece-make-identity channel)
                        riece-channel-buffer-alist))))
       (riece-insert-change
         (pointer channels)
         (message (car (riece-split-parameters string))))
     ;; If you are quitting, no need to cleanup.
-    (unless (string-equal-ignore-case user riece-real-nickname)
+    (unless (scandinavian-equal-ignore-case user riece-real-nickname)
       ;; You were talking with the user.
-      (if (riece-identity-member-no-server (riece-make-identity user)
-                                          riece-current-channels)
+      (if (riece-identity-member (riece-make-identity user)
+                                riece-current-channels)
          (riece-part-channel user)) ;XXX
       (setq pointer channels)
       (while pointer
       (let ((buffers
             (mapcar
              (lambda (channel)
-               (cdr (riece-identity-assoc-no-server
+               (cdr (riece-identity-assoc
                      (riece-make-identity channel)
                      riece-channel-buffer-alist)))
              channels)))
         (channels (copy-sequence (riece-user-get-channels user)))
         pointer)
     ;; You were talking with the user.
-    (if (riece-identity-member-no-server (riece-make-identity user)
-                                        riece-current-channels)
+    (if (riece-identity-member (riece-make-identity user)
+                              riece-current-channels)
        (riece-part-channel user)) ;XXX
     (setq pointer channels)
     (while pointer
     (let ((buffers
           (mapcar
            (lambda (channel)
-             (cdr (riece-identity-assoc-no-server
+             (cdr (riece-identity-assoc
                    (riece-make-identity channel)
                    riece-channel-buffer-alist)))
            channels)))
         (channel (car parameters))
         (topic (nth 1 parameters)))
     (riece-channel-set-topic (riece-get-channel channel) topic)
-    (let ((buffer (cdr (riece-identity-assoc-no-server
+    (let ((buffer (cdr (riece-identity-assoc
                        (riece-make-identity channel)
                        riece-channel-buffer-alist))))
       (riece-insert-change
       (setq channel (match-string 1 string)
            string (substring string (match-end 0)))
       (riece-parse-channel-modes string channel)
-      (let ((buffer (cdr (riece-identity-assoc-no-server
+      (let ((buffer (cdr (riece-identity-assoc
                          (riece-make-identity channel)
                          riece-channel-buffer-alist))))
        (riece-insert-change
index 43396f5..0591c81 100644 (file)
        (concat prefix " " server)
       prefix)))
 
-(defun riece-identity-equal-no-server (ident1 ident2)
-  "Return t, if IDENT1 and IDENT2 is equal.
-The only difference with `riece-identity-equal', this function doesn't
-append server name before comparison."
-  (and (string-equal-ignore-case
+(defun riece-identity-equal (ident1 ident2)
+  "Return t, if IDENT1 and IDENT2 is equal."
+  (and (scandinavian-equal-ignore-case
        (riece-identity-prefix ident1)
        (riece-identity-prefix ident2))
        (equal
        (riece-identity-server ident1)
        (riece-identity-server ident2))))
 
-(defun riece-identity-equal (ident1 ident2)
-  "Return t, if IDENT1 and IDENT2 is equal."
-  (riece-identity-equal-no-server
+(defun riece-identity-equal-safe (ident1 ident2)
+  "Return t, if IDENT1 and IDENT2 is equal.
+The only difference with `riece-identity-equal', this function appends
+server name before comparison."
+  (riece-identity-equal
    (if (riece-identity-server ident1)
        ident1
      (riece-make-identity ident1))
@@ -91,44 +91,46 @@ append server name before comparison."
        ident2
      (riece-make-identity ident2))))
 
-(defun riece-identity-member-no-server (elt list)
-  "Return non-nil if an identity ELT is an element of LIST.
-The only difference with `riece-identity-member', this function uses
-`riece-identity-equal-no-server' for comparison."
+(defun riece-identity-member (elt list)
+  "Return non-nil if an identity ELT is an element of LIST."
   (catch 'found
     (while list
       (if (and (stringp (car list))
-              (riece-identity-equal-no-server (car list) elt))
+              (riece-identity-equal (car list) elt))
          (throw 'found list)
        (setq list (cdr list))))))
 
-(defun riece-identity-member (elt list)
-  "Return non-nil if an identity ELT is an element of LIST."
+(defun riece-identity-member-safe (elt list)
+  "Return non-nil if an identity ELT is an element of LIST.
+The only difference with `riece-identity-member', this function uses
+`riece-identity-equal-safe' for comparison."
   (catch 'found
     (while list
       (if (and (stringp (car list))
-              (riece-identity-equal (car list) elt))
+              (riece-identity-equal-safe (car list) elt))
          (throw 'found list)
        (setq list (cdr list))))))
 
-(defun riece-identity-assoc-no-server (elt alist)
+(defun riece-identity-assoc (elt alist)
   "Return non-nil if an identity ELT matches the car of an element of ALIST."
   (catch 'found
     (while alist
-      (if (riece-identity-equal-no-server (car (car alist)) elt)
+      (if (riece-identity-equal (car (car alist)) elt)
          (throw 'found (car alist))
        (setq alist (cdr alist))))))
 
-(defun riece-identity-assoc (elt alist)
-  "Return non-nil if an identity ELT matches the car of an element of ALIST."
+(defun riece-identity-assoc-safe (elt alist)
+  "Return non-nil if an identity ELT matches the car of an element of ALIST.
+The only difference with `riece-identity-assoc', this function uses
+`riece-identity-equal-safe' for comparison."
   (catch 'found
     (while alist
-      (if (riece-identity-equal (car (car alist)) elt)
+      (if (riece-identity-equal-safe (car (car alist)) elt)
          (throw 'found (car alist))
        (setq alist (cdr alist))))))
 
 (defun riece-identity-assign-binding (item list binding)
-  (let ((slot (riece-identity-member item binding))
+  (let ((slot (riece-identity-member-safe item binding))
        pointer)
     (unless list                       ;we need at least one room
       (setq list (list nil)))
index b7ce500..8c85d4a 100644 (file)
 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
-;;; Code:
-
-(defsubst string-equal-ignore-case (s1 s2)
-  (string-equal (upcase s1) (upcase s2)))
+;;; Commentary:
 
-(defsubst string-list-member-ignore-case (thing list)
-  (catch 'found
-    (while list
-      (if (and (stringp (car list))
-              (string-equal-ignore-case (car list) thing))
-         (throw 'found list)
-       (setq list (cdr list))))))
+;; RFC2812, 2.2 "Character codes" says:
+;;    Because of IRC's Scandinavian origin, the characters {}|^ are
+;;    considered to be the lower case equivalents of the characters []\~,
+;;    respectively. This is a critical issue when determining the
+;;    equivalence of two nicknames or channel names.
 
-(defsubst string-list-delete-ignore-case (thing list)
-  (let ((pointer (string-list-member-ignore-case thing list)))
-    (if pointer
-       (delq (car pointer) list)
-      list)))
+;;; Code:
 
-(defsubst string-list-delete (thing list)
-  (let ((pointer (member thing list)))
-    (if pointer
-       (delq (car pointer) list)
-      list)))
+(defsubst scandinavian-downcase (string)
+  (let* ((result (downcase string))
+        (length (length result))
+        (index 0))
+    (while (< index length)
+      (if (eq (aref result index) ?\[)
+         (aset result index ?{)
+       (if (eq (aref result index) ?\])
+           (aset result index ?})
+         (if (eq (aref result index) ?\\)
+             (aset result index ?|)
+           (if (eq (aref result index) ?~)
+               (aset result index ?^)))))
+      (setq index (1+ index)))
+    result))
 
-(defsubst string-list-modify-ignore-case (modifiers list)
-  (while modifiers
-    (let ((pointer (string-list-member-ignore-case
-                   (car (car modifiers)) list)))
-      (if pointer
-         (setcar pointer (cdr (car modifiers))))
-      (setq modifiers (cdr modifiers)))))
+(defsubst scandinavian-equal-ignore-case (s1 s2)
+  (string-equal (scandinavian-downcase s1) (scandinavian-downcase s2)))
 
-(defsubst string-assoc-ignore-case (key list)
+(defsubst scandinavian-member-ignore-case (thing list)
   (catch 'found
     (while list
-      (if (and (car-safe (car list))
-              (string-equal-ignore-case key (car (car list))))
-         (throw 'found (car list))
+      (if (and (stringp (car list))
+              (scandinavian-equal-ignore-case (car list) thing))
+         (throw 'found list)
        (setq list (cdr list))))))
 
 (provide 'riece-inlines)
index ae3c7ba..bf28310 100644 (file)
 
 (defun riece-message-buffer (message)
   "Return the buffer where MESSAGE should appear."
-  (let* ((target (if (riece-identity-equal-no-server
+  (let* ((target (if (riece-identity-equal
                      (riece-message-target message)
                      (riece-current-nickname))
                     (riece-message-speaker message)
                   (riece-message-target message)))
-        (entry (riece-identity-assoc-no-server
-                target riece-channel-buffer-alist)))
+        (entry (riece-identity-assoc target riece-channel-buffer-alist)))
     (unless entry
       (riece-join-channel target)
       ;; If you are not joined any channel,
       (unless riece-current-channel
        (riece-switch-to-channel target))
       (riece-redisplay-buffers)
-      (setq entry (riece-identity-assoc-no-server
-                  target riece-channel-buffer-alist)))
+      (setq entry (riece-identity-assoc target riece-channel-buffer-alist)))
     (cdr entry)))
 
 (defun riece-message-parent-buffers (message buffer)
 Normally they are *Dialogue* and/or *Others*."
   (if (or (and buffer (riece-frozen buffer))
          (and riece-current-channel
-              (not (riece-identity-equal-no-server
+              (not (riece-identity-equal
                     (riece-message-target message)
                     riece-current-channel))))
       (list riece-dialogue-buffer riece-others-buffer)
@@ -198,13 +196,13 @@ Currently possible values are `action' and `notice'."
   "Return t if MESSAGE is a private message."
   (if (riece-message-own-p message)
       (not (riece-channel-p (riece-message-target message)))
-    (riece-identity-equal-no-server
+    (riece-identity-equal
      (riece-message-target message)
      (riece-current-nickname))))
 
 (defun riece-message-external-p (message)
   "Return t if MESSAGE is from outside the channel."
-  (not (riece-identity-member-no-server
+  (not (riece-identity-member
        (riece-message-target message)
        (mapcar #'riece-make-identity
                (riece-user-get-channels (riece-message-speaker message))))))
index fa085ba..afd7f7e 100644 (file)
 (require 'riece-display)
 
 (defun riece-naming-assert-join (user-name channel-name)
-  (if (string-equal-ignore-case user-name riece-real-nickname)
+  (if (scandinavian-equal-ignore-case user-name riece-real-nickname)
       (riece-join-channel channel-name))
   (riece-user-toggle-channel user-name channel-name t)
   (riece-channel-toggle-user channel-name user-name t))
 
 (defun riece-naming-assert-part (user-name channel-name)
-  (if (string-equal-ignore-case user-name riece-real-nickname)
+  (if (scandinavian-equal-ignore-case user-name riece-real-nickname)
       (progn
        (riece-part-channel channel-name)
        (riece-forget-channel channel-name))
     (riece-channel-toggle-user channel-name user-name nil)
     (riece-channel-toggle-operator channel-name user-name nil)
     (riece-channel-toggle-speaker channel-name user-name nil)
-    (if (riece-identity-equal user-name (riece-current-nickname))
+    (if (riece-identity-equal-safe user-name (riece-current-nickname))
        (let* ((identity (riece-make-identity channel-name))
-              (pointer (riece-identity-member
+              (pointer (riece-identity-member-safe
                         identity riece-current-channels)))
          (if pointer
              (setcar pointer nil))))))
 
 (defun riece-naming-assert-rename (old-name new-name)
-  (if (string-equal-ignore-case old-name riece-real-nickname)
+  (if (scandinavian-equal-ignore-case old-name riece-real-nickname)
       (setq riece-last-nickname riece-real-nickname
            riece-real-nickname new-name))
   (let* ((old (riece-get-user old-name))
index a5ba608..74b6375 100644 (file)
@@ -192,7 +192,7 @@ Only used for sending files."
            (port (string-to-number (match-string 3 message)))
            (size (string-to-number (match-string 4 message)))
            (buffer (if (riece-channel-p target)
-                       (cdr (riece-identity-assoc-no-server
+                       (cdr (riece-identity-assoc
                              (riece-make-identity target)
                              riece-channel-buffer-alist))))
            (user (riece-prefix-nickname prefix)))
index 48c3809..b77c978 100644 (file)
@@ -267,7 +267,7 @@ puts(\"#{" address " >> 24 & 0xFF}.#{" address " >> 16 & 0xFF}.#{"
            (port (string-to-number (match-string 3 message)))
            (size (string-to-number (match-string 4 message)))
            (buffer (if (riece-channel-p target)
-                       (cdr (riece-identity-assoc-no-server
+                       (cdr (riece-identity-assoc
                              (riece-make-identity target)
                              riece-channel-buffer-alist))))
            (user (riece-prefix-nickname prefix)))
index 197d765..eff9521 100644 (file)
@@ -23,7 +23,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'riece-inlines))   ;string-assoc-ignore-case, etc.
+(eval-when-compile (require 'riece-inlines))   ;scandinavian-downcase
 
 (require 'riece-identity)
 
 (defun riece-find-user (name)
   "Get a user object named NAME from the server buffer."
   (riece-with-server-buffer
-   (let ((symbol (intern-soft (downcase (riece-identity-prefix name))
+   (let ((symbol (intern-soft (scandinavian-downcase
+                              (riece-identity-prefix name))
                              riece-obarray)))
      (if symbol
         (symbol-value symbol)))))
 
 (defun riece-forget-user (name)
   (riece-with-server-buffer
-   (let ((symbol (intern-soft (downcase (riece-identity-prefix name)))))
+   (let ((symbol (intern-soft (scandinavian-downcase
+                              (riece-identity-prefix name)))))
      (when symbol
        (makunbound symbol)
        (unintern (symbol-name symbol) riece-obarray)))))
 
 (defun riece-rename-user (old-name new-name)
   (riece-with-server-buffer
-   (unless (equal (downcase (riece-identity-prefix old-name))
-                 (downcase (riece-identity-prefix new-name)))
-     (let ((symbol (intern-soft (downcase (riece-identity-prefix old-name))
+   (unless (equal (scandinavian-downcase
+                  (riece-identity-prefix old-name))
+                 (scandinavian-downcase
+                  (riece-identity-prefix new-name)))
+     (let ((symbol (intern-soft (scandinavian-downcase
+                                (riece-identity-prefix old-name))
                                riece-obarray)))
        (when symbol
-        (set (intern (downcase (riece-identity-prefix new-name))
+        (set (intern (scandinavian-downcase
+                      (riece-identity-prefix new-name))
                      riece-obarray)
              (symbol-value symbol))
         (makunbound symbol)
@@ -67,11 +73,13 @@ away status, respectively."
 
 (defun riece-get-user (name)
   (riece-with-server-buffer
-   (let ((symbol (intern-soft (downcase (riece-identity-prefix name))
+   (let ((symbol (intern-soft (scandinavian-downcase
+                              (riece-identity-prefix name))
                              riece-obarray)))
      (if symbol
         (symbol-value symbol)
-       (set (intern (downcase (riece-identity-prefix name)) riece-obarray)
+       (set (intern (scandinavian-downcase
+                    (riece-identity-prefix name)) riece-obarray)
            (riece-make-user))))))
 
 (defun riece-user-channels (user)