* riece-300.el (riece-353-message-alist): Renamed from riece-353-string.
authorueno <ueno>
Fri, 4 Feb 2005 08:44:12 +0000 (08:44 +0000)
committerueno <ueno>
Fri, 4 Feb 2005 08:44:12 +0000 (08:44 +0000)
lisp/ChangeLog
lisp/riece-300.el

index 117325d..394331d 100644 (file)
@@ -2,7 +2,7 @@
 
        * riece-filter.el (riece-filter): Accept lines which end with LF.
 
-       * riece-300.el (riece-353-string): Renamed from riece-353-users.
+       * riece-300.el (riece-353-message-alist): Renamed from riece-353-users.
        (riece-handle-353-message): Don't parse the reply.
        (riece-handle-366-message): Parse 353 replies here; count users.
 
index 018144c..dd33c6d 100644 (file)
                 (substring string (match-end 0))))
        "\n"))))
 
-(defvar riece-353-string nil)
+(defvar riece-353-message-alist nil)
 (defun riece-handle-353-message (prefix number name string)
   "RPL_NAMREPLY        \"[=\*@] <channel> :[[@|+]<nick> [[@|+]<nick> [...]]]\"."
+  (make-local-variable 'riece-353-message-alist)      
   (if (string-match "^[=\*@] *\\([^ ]+\\) +:?" string)
-      (let ((channel (match-string 1 string))
-           (start 0)
-           user)
-       (make-local-variable 'riece-353-string)
-       (setq riece-353-string (concat riece-353-string
-                                      (substring string (match-end 0)))))))
+      (let* ((channel (match-string 1 string))
+            (entry (assoc channel riece-353-message-alist)))
+       (if entry
+           (setcdr entry
+                   (concat (cdr entry)
+                           (substring string (match-end 0))))
+         (setq riece-353-message-alist
+               (cons (cons channel (substring string (match-end 0)))
+                     riece-353-message-alist))))))
 
 (defun riece-handle-322-message (prefix number name string)
   (if (string-match "^\\([^ ]+\\) \\([0-9]+\\) :?" string)
             (channel-identity (riece-make-identity channel
                                                    riece-server-name))
             (buffer (riece-channel-buffer channel-identity))
-            (string (copy-sequence riece-353-string))
+            (entry (assoc channel riece-353-message-alist))
+            (string (cdr entry))
             (start 0)
             users)
-       (setq riece-353-string nil)
+       (if entry
+           (setcdr entry nil))
        (while (string-match
                (concat "\\([@+]\\)?\\(" riece-user-regexp "\\) *")
                string start)