* riece-globals.el (riece-join-channel-candidate): New variable.
[riece] / lisp / riece-handle.el
index 2ca23eb..e35515e 100644 (file)
 (defun riece-handle-invite-message (prefix string)
   (let* ((user (riece-prefix-nickname prefix))
         (parameters (riece-split-parameters string))
-        (channel (car parameters)))
+        (invited (car 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
       (riece-concat-server-name
-       (format "%s invites you to %s"
+       (format "%s invites %s to %s"
               (riece-format-identity (riece-make-identity
                                       user riece-server-name))
               (riece-format-identity (riece-make-identity
-                                      channel riece-server-name))))
+                                      invited riece-server-name))
+              (riece-format-identity channel-identity)))
       "\n"))))
 
 (defun riece-handle-topic-message (prefix string)