(riece-twitter-update): Don't send extra
authorDaiki Ueno <ueno@unixuser.org>
Sat, 13 Oct 2007 10:17:55 +0000 (10:17 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Sat, 13 Oct 2007 10:17:55 +0000 (10:17 +0000)
headers only if it is called interactively.

lisp/ChangeLog
lisp/riece-twitter.el

index 3a5510f..f0eceee 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-13  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-twitter.el (riece-twitter-update): Don't send extra
+       headers only if it is called interactively.
+
 2007-10-12  Daiki Ueno  <ueno@unixuser.org>
 
        * riece-twitter.el (riece-twitter-update): Don't send extra headers.
 2007-10-12  Daiki Ueno  <ueno@unixuser.org>
 
        * riece-twitter.el (riece-twitter-update): Don't send extra headers.
index a88330d..a227cbb 100644 (file)
               "\\[riece-twitter-set-credential] to set your credential")))
      (list (read-string "Status: "))))
   (message "Sending to Twitter...")
               "\\[riece-twitter-set-credential] to set your credential")))
      (list (read-string "Status: "))))
   (message "Sending to Twitter...")
-  (let ((process
-        (start-process
-         "curl" nil "curl"
-;;       "-H" "X-Twitter-Client: Riece"
-;;       "-H" (concat "X-Twitter-Client-Version: " riece-version-number)
-;;       "-H" "X-Twitter-Client-URL: http://riece.nongnu.org/twitter.xml"
-         "-u" riece-twitter-credential
-;;       "-d" "source=riece"
-         "-d" (concat "status="
-                      (riece-twitter-escape-string
-                       (encode-coding-string status 'utf-8)))
-         "-s"
-         "http://twitter.com/statuses/update.json")))
+  (let* ((args
+         (list "-u" riece-twitter-credential
+               "-d" (concat "status="
+                            (riece-twitter-escape-string
+                             (encode-coding-string status 'utf-8)))
+               "-s"
+               "http://twitter.com/statuses/update.json"))
+        (process
+         (apply #'start-process
+                "curl" nil "curl"
+                (if (interactive-p)
+                    args
+                  (append args
+                          (list "-H" "X-Twitter-Client: Riece"
+                                "-H" (concat "X-Twitter-Client-Version: "
+                                             riece-version-number)
+                                "-H" "X-Twitter-Client-URL: http://riece.nongnu.org/twitter.xml"
+                                "-d" "source=riece"))))))
     (set-process-sentinel process #'riece-twitter-sentinel)))
 
 (defun riece-twitter-sentinel (process status)
     (set-process-sentinel process #'riece-twitter-sentinel)))
 
 (defun riece-twitter-sentinel (process status)