Skip to content

Commit

Permalink
Use the ID of the retweeted original tweet on handling a retweet.
Browse files Browse the repository at this point in the history
* twittering-mode.el: Use the ID of the retweeted original tweet
on generating a URL or retweeting it.
(twittering-status-to-status-datum): add new property `source-id'
specifying a source tweet of a retweet.
(twittering-generate-formater-for-first-spec): generate a URL for
a retweet from the ID of its source.
(twittering-generate-format-status-function): add `source-id' as a
common property.
(twittering-native-retweet): use `source-id' for a retweet.
  • Loading branch information
cvmat committed Aug 6, 2010
1 parent dfec772 commit 70e9faa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Expand Up @@ -5,6 +5,16 @@
(twittering-start-http-session-curl): add an option "-d" whenever
`method' equals to "POST".

* twittering-mode.el: Use the ID of the retweeted original tweet
on generating a URL or retweeting it.
(twittering-status-to-status-datum): add new property `source-id'
specifying a source tweet of a retweet.
(twittering-generate-formater-for-first-spec): generate a URL for
a retweet from the ID of its source.
(twittering-generate-format-status-function): add `source-id' as a
common property.
(twittering-native-retweet): use `source-id' for a retweet.

2010-07-25 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-mode): avoid repeating
Expand Down
12 changes: 9 additions & 3 deletions twittering-mode.el
Expand Up @@ -4412,6 +4412,7 @@ BUFFER may be a buffer or the name of an existing buffer."
'(id text source created-at truncated
in-reply-to-status-id
in-reply-to-screen-name
source-id
user-id user-name user-screen-name user-location
user-description
user-profile-image-url
Expand Down Expand Up @@ -5081,7 +5082,8 @@ following symbols;
(url
(twittering-get-status-url
(cdr (assq 'user-screen-name ,status-sym))
(cdr (assq 'id ,status-sym))))
(or (cdr (assq 'source-id ,status-sym))
(cdr (assq 'id ,status-sym)))))
(properties
(list 'mouse-face 'highlight 'face 'twittering-uri-face
'uri url)))
Expand Down Expand Up @@ -5168,8 +5170,11 @@ following symbols;
`(lambda (status prefix)
(let* ((username (cdr (assq 'user-screen-name status)))
(id (cdr (assq 'id status)))
(source-id (cdr (assq 'source-id status)))
(text (cdr (assq 'text status)))
(common-properties (list 'username username 'id id 'text text))
(common-properties
(list 'username username 'id id 'source-id source-id
'text text))
(str (concat ,@body))
(str (if prefix
(replace-regexp-in-string "^" prefix str)
Expand Down Expand Up @@ -5723,7 +5728,8 @@ managed by `twittering-mode'."

(defun twittering-native-retweet ()
(interactive)
(let ((id (get-text-property (point) 'id))
(let ((id (or (get-text-property (point) 'source-id)
(get-text-property (point) 'id)))
(text (copy-sequence (get-text-property (point) 'text)))
(user (get-text-property (point) 'username))
(width (max 40 ;; XXX
Expand Down

0 comments on commit 70e9faa

Please sign in to comment.