(cf. the last paragraph of `kill-buffer' docstring)
[riece] / lisp / riece-rdcc.el
index 711977a..e02b587 100644 (file)
@@ -27,6 +27,7 @@
 (require 'riece-misc)
 (require 'riece-channel)
 (require 'riece-identity)
+(require 'riece-ctcp)                  ;for riece-ctcp-additional-clientinfo
 
 (defgroup riece-rdcc nil
   "DCC implementation using ruby"
@@ -114,8 +115,7 @@ puts(\"#{" address " >> 24 & 0xFF}.#{" address " >> 16 & 0xFF}.#{"
 (defun riece-rdcc-server-sentinel (process status)
   (with-current-buffer (process-buffer process)
     (message "Sending %s...done" riece-rdcc-request-file))
-  (kill-buffer (process-buffer process))
-  (delete-process process))
+  (kill-buffer (process-buffer process)))
 
 (defun riece-command-dcc-send (user file)
   (interactive
@@ -125,7 +125,8 @@ puts(\"#{" address " >> 24 & 0xFF}.#{" address " >> 16 & 0xFF}.#{"
            (mapcar #'list (riece-get-users-on-server)))
           (expand-file-name (read-file-name "File: ")))))
   (let ((process
-        (start-process "DCC send" " *DCC send*" "ruby" "-rsocket")))
+        (start-process "DCC" (generate-new-buffer " *DCC*")
+                       "ruby" "-rsocket")))
     (process-send-string process
                         (apply #'concat
                                (riece-rdcc-substitute-variables
@@ -184,8 +185,7 @@ puts(\"#{" address " >> 24 & 0xFF}.#{" address " >> 16 & 0xFF}.#{"
     (let ((coding-system-for-write 'binary)
          jka-compr-compression-info-list jam-zcat-filename-list)
       (write-region (point-min) (point-max) riece-rdcc-request-file)))
-  (kill-buffer (process-buffer process))
-  (delete-process process))
+  (kill-buffer (process-buffer process)))
 
 (defun riece-rdcc-decode-address (address)
   (with-temp-buffer
@@ -237,7 +237,7 @@ puts(\"#{" address " >> 24 & 0xFF}.#{" address " >> 16 & 0xFF}.#{"
         (coding-system-for-read 'binary)
         (coding-system-for-write 'binary)
         (process (open-network-stream
-                  "DCC receive" " *DCC receive*"
+                  "DCC" (generate-new-buffer " *DCC*")
                   (riece-rdcc-decode-address (nth 2 request))
                   (nth 3 request))))
     (setq riece-rdcc-requests (delq request riece-rdcc-requests))
@@ -265,7 +265,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)))
@@ -293,6 +293,7 @@ puts(\"#{" address " >> 24 & 0xFF}.#{" address " >> 16 & 0xFF}.#{"
 
 (defvar riece-dialogue-mode-map)
 (defun riece-rdcc-insinuate ()
+  (add-to-list 'riece-ctcp-additional-clientinfo "DCC" t)
   (add-hook 'riece-ctcp-dcc-request-hook 'riece-handle-dcc-request)
   (define-key riece-dialogue-mode-map "\C-ds" 'riece-command-dcc-send)
   (define-key riece-dialogue-mode-map "\C-dr" 'riece-command-dcc-receive))