Permalink
Browse files

Fix a URL for a native retweet.

* twittering-mode.el: Fix a URL for a native retweet. It was
generated from a screen-name of the retweeting user and an ID of
the retweeted original tweet.
(twittering-get-status-url-from-alist): explicitly use the
retweeted original tweet when making a URL for a native retweet.
(twittering-push-uri-onto-kill-ring): simply send a tweet alist
itself to the function `twittering-get-status-url-from-alist'.
  • Loading branch information...
1 parent c909aa5 commit dae4490eb25c3111205fd3b8d43b61d4985fc640 @cvmat cvmat committed Dec 8, 2013
Showing with 17 additions and 6 deletions.
  1. +8 −0 ChangeLog
  2. +1 −0 NEWS
  3. +1 −0 NEWS.ja
  4. +7 −6 twittering-mode.el
View
@@ -13,6 +13,14 @@
`retweet-count' and `favorite-count' in an alist representing a
tweet.
+ * twittering-mode.el: Fix a URL for a native retweet. It was
+ generated from a screen-name of the retweeting user and an ID of
+ the retweeted original tweet.
+ (twittering-get-status-url-from-alist): explicitly use the
+ retweeted original tweet when making a URL for a native retweet.
+ (twittering-push-uri-onto-kill-ring): simply send a tweet alist
+ itself to the function `twittering-get-status-url-from-alist'.
+
2013-12-09 tomykaira <tomykaira@gmail.com>
* twittering-mode.el: Fix arguments of `twittering-http-post'.
View
1 NEWS
@@ -11,6 +11,7 @@
### Bug fixes
* Fix of invoking a hook twice for the same timeline.
+* Fix a URL for a native retweet.
3.0.0: 2013-04-21
------------------
View
@@ -11,6 +11,7 @@
### バグ修正
* 同一のtimelineに対してhookが二重に実行されるバグを修正
+* 公式ReTweetに対するURLを修正
3.0.0: 2013-04-21
------------------
View
@@ -4806,8 +4806,10 @@ string and the number of new statuses for the timeline."
(defun twittering-get-status-url-from-alist (status)
"Generate a URL of a tweet specified by an alist STATUS."
- (let ((username (cdr (assq 'user-screen-name status)))
- (id (cdr (assq 'id status)))
+ (let ((username (cdr (or (assq 'retweeted-user-screen-name status)
+ (assq 'user-screen-name status))))
+ (id (cdr (or (assq 'retweeted-id status)
+ (assq 'id status))))
(func
(cdr (assq
'status-url
@@ -11723,10 +11725,9 @@ and a tweet is pointed, the URI to the tweet is insteadly pushed."
(interactive)
(let ((uri (or (get-text-property (point) 'uri)
(if (get-text-property (point) 'field)
- (let ((id (or (get-text-property (point) 'retweeted-id)
- (get-text-property (point) 'id)))
- (username (get-text-property (point) 'username)))
- (twittering-get-status-url username id))
+ (let* ((id (get-text-property (point) 'id))
+ (status (twittering-find-status id)))
+ (twittering-get-status-url-from-alist status))
nil))))
(cond
((not (stringp uri))

0 comments on commit dae4490

Please sign in to comment.