* riece-globals.el (riece-join-channel-candidate): New variable.
authorueno <ueno>
Sat, 4 Oct 2003 23:56:12 +0000 (23:56 +0000)
committerueno <ueno>
Sat, 4 Oct 2003 23:56:12 +0000 (23:56 +0000)
* riece-commands.el (riece-command-join): Prompt
riece-join-channel-candidate.

* riece-handle.el (riece-handle-invite-message): Set
riece-join-channel-candidate when the user is invited.
* riece-naming.el (riece-naming-assert-join): Clear
riece-join-channel-candidate.

lisp/ChangeLog
lisp/riece-commands.el
lisp/riece-globals.el
lisp/riece-handle.el
lisp/riece-naming.el

index 094a7e7..1e7e8c0 100644 (file)
@@ -1,5 +1,16 @@
 2003-10-04  Daiki Ueno  <ueno@unixuser.org>
 
+       * riece-globals.el (riece-join-channel-candidate): New variable.
+       * riece-commands.el (riece-command-join): Prompt
+       riece-join-channel-candidate.
+
+       * riece-handle.el (riece-handle-invite-message): Set
+       riece-join-channel-candidate when the user is invited.
+       * riece-naming.el (riece-naming-assert-join): Clear
+       riece-join-channel-candidate.
+
+2003-10-04  Daiki Ueno  <ueno@unixuser.org>
+
        * riece-identity.el (riece-completing-read-identity): Pass 6th &
        7th arguments to completing-read.
 
index 3d0f9a9..3e3c614 100644 (file)
@@ -421,8 +421,14 @@ the layout to the selected layout-name."
   (interactive
    (let* ((completion-ignore-case t)
          (target
-          (riece-completing-read-identity
-           "Channel/User: " riece-current-channels))
+          (if riece-join-channel-candidate
+              (let ((default (riece-format-identity
+                              riece-join-channel-candidate)))
+                (riece-completing-read-identity
+                 (format "Channel/User (default %s): " default)
+                 riece-current-channels nil nil nil nil default))
+            (riece-completing-read-identity
+             "Channel/User: " riece-current-channels)))
          key)
      (if (and current-prefix-arg
              (riece-channel-p (riece-identity-prefix target)))
index 51b58c3..c3fc949 100644 (file)
@@ -38,6 +38,8 @@
   "The channel you currently have joined.")
 (defvar riece-current-channels nil
   "The channels you have currently joined.")
+(defvar riece-join-channel-candidate nil
+  "The candidate for channel to be used with the next join command.")
 
 (defvar riece-save-variables-are-dirty nil
   "Non nil if the variables in `riece-saved-forms' are changed.")
index 56852d0..e35515e 100644 (file)
   (let* ((user (riece-prefix-nickname prefix))
         (parameters (riece-split-parameters string))
         (invited (car parameters))
-        (channel (nth 1 parameters)))
+        (channel (nth 1 parameters))
+        (channel-identity (riece-make-identity channel riece-server-name)))
+    (if (riece-identity-equal-no-server invited riece-real-nickname)
+       (setq riece-join-channel-candidate channel-identity))
     (riece-insert-info
      (list riece-dialogue-buffer riece-others-buffer)
      (concat
                                       user riece-server-name))
               (riece-format-identity (riece-make-identity
                                       invited riece-server-name))
-              (riece-format-identity (riece-make-identity
-                                      channel riece-server-name))))
+              (riece-format-identity channel-identity)))
       "\n"))))
 
 (defun riece-handle-topic-message (prefix string)
index 6a59cd2..ca9d8a0 100644 (file)
@@ -36,7 +36,8 @@
       (let ((channel-identity (riece-make-identity channel-name
                                                   riece-server-name)))
        (riece-join-channel channel-identity)
-       (riece-switch-to-channel channel-identity))))
+       (riece-switch-to-channel channel-identity)
+       (setq riece-join-channel-candidate nil))))
 
 (defun riece-naming-assert-part (user-name channel-name)
   (riece-user-toggle-channel user-name channel-name nil)