enabled(){
  var configuration = { defaultAccount: "#preferred" };
  
  window.TDPF_loadConfigurationFile(this, "configuration.js", "configuration.default.js", obj => configuration = obj);
  
  this.lastSelectedAccount = null;
  
  this.uiInlineComposeTweetEvent = (e, data) => {
    var query;
    
    if (configuration.useAdvancedSelector){
      if (configuration.customSelector){
        var column = TD.controller.columnManager.get(data.element.closest("section.column").attr("data-column"));
        query = configuration.customSelector(column);
      }
      else{
        $TD.alert("warning", "Plugin reply-account has invalid configuration: useAdvancedSelector is true, but customSelector function is missing");
        return;
      }
    }
    else{
      query = configuration.defaultAccount;
      
      if (query === ""){
        query = "#preferred";
      }
      else if (typeof query !== "string"){
        query = "#default";
      }
    }
    
    if (typeof query === "undefined"){
      query = "#preferred";
    }
    
    if (typeof query !== "string"){
      return;
    }
    else if (query.length === 0){
      $TD.alert("warning", "Plugin reply-account has invalid configuration: the requested account is empty");
      return;
    }
    else if (query[0] !== '@' && query[0] !== '#'){
      $TD.alert("warning", "Plugin reply-account has invalid configuration: the requested account does not begin with @ or #: "+query);
      return;
    }
    
    var identifier = null;
    
    switch(query){
      case "#preferred":
        identifier = TD.storage.clientController.client.getDefaultAccount();
        break;
      
      case "#last":
        if (this.lastSelectedAccount === null){
          return;
        }
        
        identifier = this.lastSelectedAccount;
        break;
      
      case "#default":
        return;
      
      default:
        if (query[0] === '@'){
          var obj = TD.storage.accountController.getAccountFromUsername(query.substring(1));
          
          if (obj.length === 0){
            $TD.alert("warning", "Plugin reply-account has invalid configuration: requested account not found: "+query);
            return;
          }
          else{
            identifier = obj[0].privateState.key;
          }
        }
        else{
          $TD.alert("warning", "Plugin reply-account has invalid configuration: unknown requested account query: "+query);
          return;
        }
    }
    
    data.singleFrom = data.from = [ identifier ];
  };
  
  this.onSelectedAccountChanged = () => {
    var selected = $(".js-account-item.is-selected", ".js-account-list");
    this.lastSelectedAccount = selected.length === 1 ? selected.attr("data-account-key") : null;
  };
}

ready(){
  var events = $._data(document, "events");
  
  if ("uiInlineComposeTweet" in events){
    $(document).on("uiInlineComposeTweet", this.uiInlineComposeTweetEvent);
    
    var handlers = events["uiInlineComposeTweet"];
    var oldHandler = handlers[0];
    var newHandler = handlers[1];
    
    handlers[0] = newHandler;
    handlers[1] = oldHandler;
  }
  else{
    $(document).on("uiInlineComposeTweet", this.uiInlineComposeTweetEvent);
  }
  
  $(document).on("click", ".js-account-list .js-account-item", this.onSelectedAccountChanged);
}

disabled(){
  $(document).off("uiInlineComposeTweet", this.uiInlineComposeTweetEvent);
  $(document).off("click", ".js-account-list .js-account-item", this.onSelectedAccountChanged);
}
@@ -224,38 +224,32 @@
 ll;%0A  %0A  this.ui
-Inline
 ComposeTweetEven
@@ -263,24 +263,81 @@
  data) =%3E %7B%0A
+    if (data.type !== %22reply%22)%7B%0A      return;%0A    %7D%0A    %0A
     var quer
@@ -2853,20 +2853,35 @@
 );%0A  %0A  
-if (
+for(var event of %5B 
 %22uiInlin
@@ -2898,62 +2898,61 @@
 eet%22
- in events)%7B%0A    $(document).on(%22uiInlineComposeTweet%22
+, %22uiDockedComposeTweet%22 %5D)%7B%0A    $(document).on(event
 , th
@@ -2948,38 +2948,32 @@
 n(event, this.ui
-Inline
 ComposeTweetEven
@@ -3007,38 +3007,21 @@
  events%5B
-%22uiInlineComposeTweet%22
+event
 %5D;%0A    v
@@ -3023,19 +3023,19 @@
     var 
-old
+new
 Handler 
@@ -3049,197 +3049,175 @@
 ers%5B
-0%5D;%0A    var newHandler = handlers%5B1%5D;%0A    %0A    handlers%5B0%5D = newHandler;%0A    handlers%5B1%5D = oldHandler
+handlers.length-1%5D;%0A    %0A    for(var index = handlers.length-1; index %3E 0; index--)%7B%0A      handlers%5Bindex%5D = handlers%5Bindex-1%5D
 ;%0A  
+ 
+ 
 %7D%0A  
-else%7B%0A    $(document).on(%22uiInlineComposeTweet%22, this.uiInlineComposeTweetEvent)
+  %0A    handlers%5B0%5D = newHandler
 ;%0A  
@@ -3380,22 +3380,85 @@
  this.ui
-Inline
+ComposeTweetEvent);%0A  $(document).off(%22uiDockedComposeTweet%22, this.ui
 ComposeT

Fix reply-account plugin for docked replies