Skip to content

Commit

Permalink
FIX: Use unique pluginId for modifyClass
Browse files Browse the repository at this point in the history
  • Loading branch information
udan11 committed Sep 16, 2021
1 parent ed395ad commit a53765f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
Expand Up @@ -20,7 +20,7 @@ export default {

withPluginApi("0.11.3", (api) => {
api.modifyClassStatic("model:post", {
pluginId: "discourse-encrypt",
pluginId: "decrypt-post-revisions",

loadRevision() {
return this._super(...arguments).then((result) => {
Expand Down
Expand Up @@ -36,7 +36,7 @@ export default {
withPluginApi("0.11.3", (api) => {
// Check recipients and show encryption status in composer.
api.modifyClass("model:composer", {
pluginId: "discourse-encrypt",
pluginId: "encrypt-composer",

@on("init")
@observes("creatingPrivateMessage", "topic")
Expand Down
Expand Up @@ -4,12 +4,12 @@ import Post from "discourse/models/post";
import I18n from "I18n";

export default {
name: "hook-topic-controller",
name: "encrypt-delete-topic",

initialize() {
withPluginApi("0.11.3", (api) => {
api.modifyClass("controller:topic", {
pluginId: "discourse-encrypt",
pluginId: "encrypt-delete-topic",

permanentDeleteConfirmation(callback) {
bootbox.confirm(
Expand Down
4 changes: 2 additions & 2 deletions assets/javascripts/discourse/initializers/encrypt-drafts.js
Expand Up @@ -55,7 +55,7 @@ export default {

withPluginApi("0.11.3", (api) => {
api.modifyClassStatic("model:draft", {
pluginId: "discourse-encrypt",
pluginId: "encrypt-drafts",

save(draftKey, sequence, data, clientId) {
// TODO: https://github.com/emberjs/ember.js/issues/15291
Expand Down Expand Up @@ -118,7 +118,7 @@ export default {
});

api.modifyClass("model:user-drafts-stream", {
pluginId: "discourse-encrypt",
pluginId: "encrypt-drafts",

findItems(site) {
return this._super(site).then(() => {
Expand Down
4 changes: 2 additions & 2 deletions assets/javascripts/discourse/initializers/encrypt-posts.js
Expand Up @@ -62,7 +62,7 @@ export default {

withPluginApi("0.11.3", (api) => {
api.modifyClassStatic("model:topic", {
pluginId: "discourse-encrypt",
pluginId: "encrypt-posts",

update(topic, props) {
// TODO: https://github.com/emberjs/ember.js/issues/15291
Expand All @@ -82,7 +82,7 @@ export default {
});

api.modifyClass("adapter:post", {
pluginId: "discourse-encrypt",
pluginId: "encrypt-posts",

createRecord(store, type, args) {
// TODO: https://github.com/emberjs/ember.js/issues/15291
Expand Down
Expand Up @@ -85,7 +85,7 @@ export default {

withPluginApi("0.11.3", (api) => {
api.modifyClass("adapter:notification", {
pluginId: "discourse-encrypt",
pluginId: "fetch-encrypt-keys",

find() {
return this._super(...arguments).then((result) => {
Expand All @@ -104,7 +104,7 @@ export default {
});

api.modifyClassStatic("model:topic", {
pluginId: "discourse-encrypt",
pluginId: "fetch-encrypt-keys",

create(args) {
if (args && args.topic_key) {
Expand All @@ -116,7 +116,7 @@ export default {
});

api.modifyClass("model:topic", {
pluginId: "discourse-encrypt",
pluginId: "fetch-encrypt-keys",

updateFromJson(json) {
if (json.topic_key) {
Expand All @@ -128,7 +128,7 @@ export default {
});

api.modifyClass("model:bookmark", {
pluginId: "discourse-encrypt",
pluginId: "fetch-encrypt-keys",

loadItems(params) {
return this._super(...arguments).then((response) => {
Expand Down
Expand Up @@ -22,9 +22,9 @@ export default {

withPluginApi("0.11.3", (api) => {
api.modifyClass("model:topic", {
pluginId: "discourse-encrypt",
pluginId: "invite-to-encrypted-topic",

createInvite(user, group_names, custom_message) {
createInvite(user, group_ids, custom_message) {
// TODO: https://github.com/emberjs/ember.js/issues/15291
let { _super } = this;
if (!hasTopicKey(this.id)) {
Expand All @@ -36,9 +36,9 @@ export default {
exportKey(key, identities[user].encryptPublic)
)
.then((key) => {
ajax(`/t/${this.get("id")}/invite`, {
ajax(`/t/${this.id}/invite`, {
type: "POST",
data: { user, key, group_names, custom_message },
data: { user, key, group_ids, custom_message },
});
})
.catch((username) => {
Expand Down

0 comments on commit a53765f

Please sign in to comment.