Skip to content

Commit

Permalink
Correctly handling replies and RTs to DMs.
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarsa committed Dec 8, 2009
1 parent 396715f commit 0e630c5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
share: function (node) {
Composer.showComposeArea(true);
var el = $("#compose_tweet_area textarea");
var user = $(".user", node).text();
var user = $(".user", node).attr('screen_name');
var msg = $(".text", node).text();
el.val("RT @" + user + ": " + msg);
Composer.textareaChanged();
Expand Down Expand Up @@ -140,7 +140,11 @@
Composer.showComposeArea(true);
var el = $("#compose_tweet_area textarea");
var user = $(".user", node).attr('screen_name');
el.val("@" + user + " ");
if(tweetManager.currentTimeline == "dms") {
el.val("d " + user + " ");
} else {
el.val("@" + user + " ");
}
tweetManager.composerData.replyId = Composer.replyId = $(node).attr('tweetid');
Composer.textareaChanged();
},
Expand Down Expand Up @@ -458,7 +462,7 @@

str += '<div class="actions">';
str += '<a href="#" onclick="Composer.reply(this.parentNode.parentNode.parentNode)">Reply</a> ';
if(!tweetManager.isRetweet(tweet.id) && tweet.user.screen_name != tweetManager.twitterBackend.username()) {
if(!tweetManager.isRetweet(tweet.id) && tweet.user.screen_name != tweetManager.twitterBackend.username() && tweetManager.currentTimeline != "dms") {
str += '<a href="#" onclick="Composer.retweet(this.parentNode.parentNode.parentNode)">RT</a><div class="rt_confirm">Retweet this message: <a href="javascript:Composer.confirmRT();">Yes</a> <a href="javascript:Composer.denyRT();">No</a></div> ';
}
str += ' <a href="#" onclick="Composer.share(this.parentNode.parentNode.parentNode)">Share</a></div>';
Expand Down

0 comments on commit 0e630c5

Please sign in to comment.