Hook that allows custom logic before saving the composer

Hook that allows custom logic before saving the composer

diff --git a/app/assets/javascripts/discourse/models/composer.js.es6 b/app/assets/javascripts/discourse/models/composer.js.es6
index 9ba0afe..5f13fb0 100644
--- a/app/assets/javascripts/discourse/models/composer.js.es6
+++ b/app/assets/javascripts/discourse/models/composer.js.es6
@@ -744,15 +744,22 @@ const Composer = RestModel.extend({
     return false;
   },
 
+  // Overwrite to implement custom logic
+  beforeSave() {
+    return Ember.RSVP.Promise.resolve();
+  },
+
   save(opts) {
-    if (!this.cantSubmitPost) {
-      // change category may result in some effect for topic featured link
-      if (!this.canEditTopicFeaturedLink) {
-        this.set("featuredLink", null);
-      }
+    return this.beforeSave().then(() => {
+      if (!this.cantSubmitPost) {
+        // change category may result in some effect for topic featured link
+        if (!this.canEditTopicFeaturedLink) {
+          this.set("featuredLink", null);
+        }
 
-      return this.editingPost ? this.editPost(opts) : this.createPost(opts);
-    }
+        return this.editingPost ? this.editPost(opts) : this.createPost(opts);
+      }
+    });
   },
 
   clearState() {

GitHub sha: ee4369f9