Skip to content

Commit

Permalink
don't add parameter 'in_reply_to_status_id' if the tweet does not beg…
Browse files Browse the repository at this point in the history
…in with '@'.
  • Loading branch information
yata committed Feb 6, 2010
1 parent 10ab699 commit 8991d70
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
2010-02-06 Satoshi Yatagawa <yata_github@y.hauN.org>

* twittering-mode.el (twittering-edit-post-status): Don't add
parameter `in_reply_to_status_id' if the tweet does not begin
with `@'.
(twittering-update-status-from-minibuffer): Likewise.

2010-02-06 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-get-and-render-timeline): ignore
Expand Down
29 changes: 15 additions & 14 deletions twittering-mode.el
Expand Up @@ -1135,11 +1135,12 @@ Return nil if SPEC-STR is invalid as a timeline spec."
(setq twittering-edit-history
(cons status twittering-edit-history))
(let ((parameters `(("status" . ,status)
("source" . "twmode")
,@(if twittering-reply-to-id
`(("in_reply_to_status_id" .
,(format "%s" twittering-reply-to-id)))
nil))))
("source" . "twmode"))))
(when (and twittering-reply-to-id
(string-match "^@[a-zA-Z0-9_-]+" status))
(add-to-list 'parameters
`("in_reply_to_status_id" .
,(format "%s" twittering-reply-to-id))))
(twittering-http-post "twitter.com" "statuses/update" parameters)
(twittering-edit-close))))))

Expand Down Expand Up @@ -2306,11 +2307,13 @@ variable `twittering-status-format'."
(setq prompt "status: ")
(when (twittering-status-not-blank-p status)
(let ((parameters `(("status" . ,status-with-sign)
("source" . "twmode")
,@(if reply-to-id
`(("in_reply_to_status_id"
. ,reply-to-id))))))
(twittering-http-post "twitter.com" "statuses/update" parameters)
("source" . "twmode"))))
(when (and reply-to-id
(string-match "^@[a-zA-Z0-9_-]+" status))
(add-to-list 'parameters
`("in_reply_to_status_id" . ,reply-to-id)))
(twittering-http-post "twitter.com" "statuses/update"
parameters)
(setq not-posted-p nil)))
)))
;; unwindforms
Expand Down Expand Up @@ -2557,8 +2560,7 @@ variable `twittering-status-format'."
(or (> emacs-major-version 21)
(eq 'utf-8 (terminal-coding-system))))
(twittering-http-post
"twitter.com"
"statuses/update"
"twitter.com" "statuses/update"
`(("status" . ,(mapconcat
'char-to-string
(mapcar 'twittering-ucs-to-char
Expand All @@ -2578,8 +2580,7 @@ variable `twittering-status-format'."
41 12301 12392 35328 12358)) "")
msg)
(twittering-http-post
"twitter.com"
"statuses/update"
"twitter.com" "statuses/update"
`(("status" . ,(concat
"@" usr " "
(match-string-no-properties 2 msg)
Expand Down

0 comments on commit 8991d70

Please sign in to comment.