From: ueno Date: Tue, 3 Jun 2003 07:00:54 +0000 (+0000) Subject: Support Scandinavian alphabets, described in RFC2812, 2.2. X-Git-Tag: strict-naming-branchpoint~8 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c242483f51f806c9607012efeb8a8985c9b2e0a;p=elisp%2Friece.git Support Scandinavian alphabets, described in RFC2812, 2.2. * 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9b4084a..9155fba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,21 @@ 2003-06-03 Daiki Ueno + * 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 + * riece-rdcc.el: Require 'riece-ctcp. (riece-rdcc-insinuate): Add "DCC" to riece-ctcp-additional-clientinfo. diff --git a/lisp/riece-300.el b/lisp/riece-300.el index 7e2b58c..f52881b 100644 --- a/lisp/riece-300.el +++ b/lisp/riece-300.el @@ -194,7 +194,7 @@ (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: " @@ -219,7 +219,7 @@ (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")) @@ -239,7 +239,7 @@ (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 @@ -267,7 +267,7 @@ (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")) @@ -293,7 +293,7 @@ (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) diff --git a/lisp/riece-channel.el b/lisp/riece-channel.el index b2cc8c5..0d32bdf 100644 --- a/lisp/riece-channel.el +++ b/lisp/riece-channel.el @@ -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) @@ -47,14 +47,16 @@ (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)))))) diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index b237282..ed5dcbd 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -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) @@ -384,7 +384,7 @@ (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) @@ -403,7 +403,7 @@ (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) @@ -439,7 +439,7 @@ (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) diff --git a/lisp/riece-ctcp.el b/lisp/riece-ctcp.el index b878347..1110ca2 100644 --- a/lisp/riece-ctcp.el +++ b/lisp/riece-ctcp.el @@ -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))) @@ -105,7 +105,7 @@ (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))) @@ -129,7 +129,7 @@ (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))) @@ -166,7 +166,7 @@ (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))) @@ -292,7 +292,7 @@ (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 diff --git a/lisp/riece-display.el b/lisp/riece-display.el index 6da4df6..021ab0a 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -234,28 +234,28 @@ (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 @@ -281,12 +281,11 @@ (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 () diff --git a/lisp/riece-handle.el b/lisp/riece-handle.el index 6ff8d2f..05a2607 100644 --- a/lisp/riece-handle.el +++ b/lisp/riece-handle.el @@ -36,27 +36,26 @@ (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) @@ -108,9 +107,9 @@ (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 @@ -141,7 +140,7 @@ (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 @@ -172,7 +171,7 @@ (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 @@ -201,10 +200,10 @@ (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 @@ -213,7 +212,7 @@ (let ((buffers (mapcar (lambda (channel) - (cdr (riece-identity-assoc-no-server + (cdr (riece-identity-assoc (riece-make-identity channel) riece-channel-buffer-alist))) channels))) @@ -244,8 +243,8 @@ (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 @@ -254,7 +253,7 @@ (let ((buffers (mapcar (lambda (channel) - (cdr (riece-identity-assoc-no-server + (cdr (riece-identity-assoc (riece-make-identity channel) riece-channel-buffer-alist))) channels))) @@ -294,7 +293,7 @@ (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 @@ -348,7 +347,7 @@ (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 diff --git a/lisp/riece-identity.el b/lisp/riece-identity.el index 43396f5..0591c81 100644 --- a/lisp/riece-identity.el +++ b/lisp/riece-identity.el @@ -70,20 +70,20 @@ (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))) diff --git a/lisp/riece-inlines.el b/lisp/riece-inlines.el index b7ce500..8c85d4a 100644 --- a/lisp/riece-inlines.el +++ b/lisp/riece-inlines.el @@ -22,45 +22,41 @@ ;; 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) diff --git a/lisp/riece-message.el b/lisp/riece-message.el index ae3c7ba..bf28310 100644 --- a/lisp/riece-message.el +++ b/lisp/riece-message.el @@ -104,13 +104,12 @@ (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, @@ -118,8 +117,7 @@ (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) @@ -127,7 +125,7 @@ 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)))))) diff --git a/lisp/riece-naming.el b/lisp/riece-naming.el index fa085ba..afd7f7e 100644 --- a/lisp/riece-naming.el +++ b/lisp/riece-naming.el @@ -32,13 +32,13 @@ (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)) @@ -46,15 +46,15 @@ (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)) diff --git a/lisp/riece-ndcc.el b/lisp/riece-ndcc.el index a5ba608..74b6375 100644 --- a/lisp/riece-ndcc.el +++ b/lisp/riece-ndcc.el @@ -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))) diff --git a/lisp/riece-rdcc.el b/lisp/riece-rdcc.el index 48c3809..b77c978 100644 --- a/lisp/riece-rdcc.el +++ b/lisp/riece-rdcc.el @@ -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))) diff --git a/lisp/riece-user.el b/lisp/riece-user.el index 197d765..eff9521 100644 --- a/lisp/riece-user.el +++ b/lisp/riece-user.el @@ -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) @@ -34,26 +34,32 @@ (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)