From 9ed8b0d904dc9ea67573b460467a7af74c8ae928 Mon Sep 17 00:00:00 2001
From: chylex <contact@chylex.com>
Date: Sun, 15 Oct 2017 23:48:56 +0200
Subject: [PATCH] Fix used account in updated middle-click actions

---
 Resources/Scripts/code.js | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/Resources/Scripts/code.js b/Resources/Scripts/code.js
index f85efd2f..e7cd6458 100644
--- a/Resources/Scripts/code.js
+++ b/Resources/Scripts/code.js
@@ -826,15 +826,13 @@
     let tweet = column.findChirp(ele.attr("data-tweet-id")) || column.findChirp(ele.attr("data-key"));
     return if !tweet;
     
-    // TODO fix "from" to accept reply-account plugin
-    
     switch($(this).attr("rel")){
       case "reply":
         let main = tweet.getMainTweet();
         
         $(document).trigger("uiDockedComposeTweet", {
           type: "reply",
-          from: [ TD.storage.clientController.client.getDefaultAccount() ],
+          from: [ tweet.account.getKey() ],
           inReplyTo: {
             id: tweet.id,
             htmlText: main.htmlText,
@@ -844,7 +842,8 @@
               profileImageURL: main.user.profileImageURL
             }
           },
-          mentions: tweet.getReplyUsers()
+          mentions: tweet.getReplyUsers(),
+          element: ele
         });
         
         break;
@@ -854,7 +853,7 @@
         break;
         
       case "retweet":
-        tweet.quoteTo([ TD.storage.clientController.client.getDefaultAccount() ]);
+        tweet.quoteTo([ tweet.account.getKey() ]); // TODO fix "from" to accept reply-account plugin
         break;
       
       default: