FEATURE: compose a new pre-filled message via URL

This commit is contained in:
Arpit Jalan
2015-11-24 18:16:42 +05:30
parent 8e95c6cf5b
commit 362c515f33
7 changed files with 47 additions and 3 deletions

View File

@ -12,7 +12,7 @@ export default Ember.Mixin.create({
});
},
openComposerWithParams(controller, topicTitle, topicBody, topicCategoryId, topicCategory) {
openComposerWithTopicParams(controller, topicTitle, topicBody, topicCategoryId, topicCategory) {
const Composer = require('discourse/models/composer').default;
this.controllerFor('composer').open({
action: Composer.CREATE_TOPIC,
@ -23,6 +23,18 @@ export default Ember.Mixin.create({
draftKey: controller.get('model.draft_key'),
draftSequence: controller.get('model.draft_sequence')
});
},
openComposerWithMessageParams(usernames, topicTitle, topicBody) {
const Composer = require('discourse/models/composer').default;
this.controllerFor('composer').open({
action: Composer.PRIVATE_MESSAGE,
usernames,
topicTitle,
topicBody,
archetypeId: 'private_message',
draftKey: 'new_private_message'
});
}
});