Skip to content

Commit

Permalink
Check if tweet is my own one.
Browse files Browse the repository at this point in the history
  • Loading branch information
naota authored and cvmat committed May 26, 2010
1 parent 4bf2583 commit 146233a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2010-05-24 Naohiro Aota <naota@elisp.net>

* twittering-mode.el (twittering-native-retweet): Check if tweet
is my own one.

2010-05-22 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el: Use the coding-system `utf-8-unix' for
Expand Down
21 changes: 12 additions & 9 deletions twittering-mode.el
Expand Up @@ -5554,6 +5554,7 @@ managed by `twittering-mode'."
(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 @@ -5562,15 +5563,17 @@ managed by `twittering-mode'."
)))
(set-text-properties 0 (length text) nil text)
(if id
(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")))
(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"))
(message "No status selected"))))

(defun twittering-favorite (&optional remove)
Expand Down

0 comments on commit 146233a

Please sign in to comment.