Skip to content

Commit

Permalink
You can retweet your own tweets.
Browse files Browse the repository at this point in the history
* twittering-mode.el: You can retweet your own tweets.
(twittering-native-retweet): retweet the given tweet without
regard to its author.
  • Loading branch information
cvmat committed Jun 16, 2016
1 parent 7c67fe6 commit 03ac74e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,3 +1,9 @@
2016-06-17 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el: You can retweet your own tweets.
(twittering-native-retweet): retweet the given tweet without
regard to its author.

2016-03-14 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el: Render an ampersand as it is posted. An
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -51,6 +51,8 @@
can be posted without errors, a tweet consisting of 116 and 24
numeric characters causes the following error;
"Status is over 140 characters."
* Retweeting your own tweet.
You can retweet your own tweet.

### Bug fixes
* Fix of invoking a hook twice for the same timeline.
Expand Down
2 changes: 2 additions & 0 deletions NEWS.ja
Expand Up @@ -48,6 +48,8 @@
- 115個の"&"と25個の数字からなるtweetは投稿可能ですが、116個の"&"と
24個の数字からなるtweetは"Status is over 140 characters."のエラー
が起こり投稿できません。
* 自分自身のtweetのretweet
自分が投稿したtweetをretweetできるようになりました。

### バグ修正
* 同一のtimelineに対してhookが二重に実行されるバグを修正
Expand Down
21 changes: 9 additions & 12 deletions twittering-mode.el
Expand Up @@ -11846,7 +11846,6 @@ How to edit a tweet is determined by `twittering-update-status-funcion'."
(interactive)
(let ((id (get-text-property (point) 'id))
(text (copy-sequence (get-text-property (point) 'text)))
(user (get-text-property (point) 'username))
(width (max 40 ;; XXX
(- (frame-width)
1 ;; margin for wide characters
Expand All @@ -11855,17 +11854,15 @@ How to edit a tweet is determined by `twittering-update-status-funcion'."
)))
(set-text-properties 0 (length text) nil text)
(if id
(if (not (string= user twittering-username))
(let ((mes (format "Retweet \"%s\"? "
(if (< width (string-width text))
(concat
(truncate-string-to-width text (- width 3))
"...")
text))))
(if (y-or-n-p mes)
(twittering-call-api 'retweet `((id . ,id)))
(message "Request canceled")))
(message "Cannot retweet your own tweet"))
(let ((mes (format "Retweet \"%s\"? "
(if (< width (string-width text))
(concat
(truncate-string-to-width text (- width 3))
"...")
text))))
(if (y-or-n-p mes)
(twittering-call-api 'retweet `((id . ,id)))
(message "Request canceled")))
(message "No status selected"))))

;;;; Commands for browsing information related to a status
Expand Down

0 comments on commit 03ac74e

Please sign in to comment.