mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 13:51:09 +08:00
DEV: Rename direct message related models
This is a followup of the previous refactor where we created two new models to handle all the dedicated logic that was present in the `ChatChannel` model. For the sake of consistency, `DMChannel` has been renamed to `DirectMessageChannel` and the previous `DirectMessageChannel` model is now named `DirectMessage`. This should help reasoning about direct messages.
This commit is contained in:

committed by
Loïc Guitaut

parent
7e992cb299
commit
abcaa1a961
@ -32,7 +32,7 @@ acceptance("Discourse Chat - Sidebar - User Status", function (needs) {
|
||||
},
|
||||
],
|
||||
},
|
||||
chatable_type: "DirectMessageChannel",
|
||||
chatable_type: "DirectMessage",
|
||||
title: "@user1",
|
||||
};
|
||||
|
||||
|
@ -95,7 +95,7 @@ acceptance("Discourse Chat - without unread", function (needs) {
|
||||
chat_channels: [],
|
||||
chatable: { users: [hawkAsJson] },
|
||||
chatable_id: 16,
|
||||
chatable_type: "DirectMessageChannel",
|
||||
chatable_type: "DirectMessage",
|
||||
chatable_url: null,
|
||||
id: 75,
|
||||
title: "@hawk",
|
||||
@ -116,7 +116,7 @@ acceptance("Discourse Chat - without unread", function (needs) {
|
||||
chat_channel: {
|
||||
id: 75,
|
||||
title: "hawk",
|
||||
chatable_type: "DirectMessageChannel",
|
||||
chatable_type: "DirectMessage",
|
||||
last_message_sent_at: "2021-07-20T08:14:16.950Z",
|
||||
chatable: {
|
||||
users: [{ username: "hawk" }],
|
||||
|
@ -51,7 +51,7 @@ acceptance("Discourse Chat - Core Sidebar", function (needs) {
|
||||
],
|
||||
},
|
||||
chatable_id: 59,
|
||||
chatable_type: "DirectMessageChannel",
|
||||
chatable_type: "DirectMessage",
|
||||
chatable_url: null,
|
||||
id: 76,
|
||||
title: "@sam",
|
||||
@ -79,7 +79,7 @@ acceptance("Discourse Chat - Core Sidebar", function (needs) {
|
||||
},
|
||||
],
|
||||
},
|
||||
chatable_type: "DirectMessageChannel",
|
||||
chatable_type: "DirectMessage",
|
||||
chatable_url: null,
|
||||
id: 77,
|
||||
title: "@<script>sam</script>",
|
||||
@ -177,7 +177,7 @@ acceptance("Discourse Chat - Core Sidebar", function (needs) {
|
||||
chat_channel: {
|
||||
id: 75,
|
||||
title: "hawk",
|
||||
chatable_type: "DirectMessageChannel",
|
||||
chatable_type: "DirectMessage",
|
||||
last_message_sent_at: "2021-07-20T08:14:16.950Z",
|
||||
chatable: {
|
||||
users: [{ username: "hawk" }],
|
||||
|
@ -51,7 +51,7 @@ acceptance("Discourse Chat - User card test", function (needs) {
|
||||
],
|
||||
},
|
||||
chatable_id: 16,
|
||||
chatable_type: "DirectMessageChannel",
|
||||
chatable_type: "DirectMessage",
|
||||
chatable_url: null,
|
||||
id: 75,
|
||||
title: "@hawk",
|
||||
|
@ -22,7 +22,7 @@ export const directMessageChannels = [
|
||||
],
|
||||
},
|
||||
chatable_id: 58,
|
||||
chatable_type: "DirectMessageChannel",
|
||||
chatable_type: "DirectMessage",
|
||||
chatable_url: null,
|
||||
id: 75,
|
||||
title: "@hawk",
|
||||
@ -53,7 +53,7 @@ export const directMessageChannels = [
|
||||
],
|
||||
},
|
||||
chatable_id: 59,
|
||||
chatable_type: "DirectMessageChannel",
|
||||
chatable_type: "DirectMessage",
|
||||
chatable_url: null,
|
||||
id: 76,
|
||||
title: "@eviltrout, @markvanlan",
|
||||
|
@ -19,7 +19,7 @@ module("Discourse Chat | Component | chat-channel-leave-btn", function (hooks) {
|
||||
this.set("onLeaveChannel", () => this.set("foo", 2));
|
||||
this.set("channel", {
|
||||
id: 1,
|
||||
chatable_type: "DirectMessageChannel",
|
||||
chatable_type: "DirectMessage",
|
||||
chatable: {
|
||||
users: [{ id: 1 }],
|
||||
},
|
||||
@ -42,7 +42,7 @@ module("Discourse Chat | Component | chat-channel-leave-btn", function (hooks) {
|
||||
template: hbs`{{chat-channel-leave-btn channel=channel}}`,
|
||||
|
||||
beforeEach() {
|
||||
this.set("channel", { chatable_type: "DirectMessageChannel" });
|
||||
this.set("channel", { chatable_type: "DirectMessage" });
|
||||
},
|
||||
|
||||
async test(assert) {
|
||||
|
@ -20,7 +20,7 @@ module(
|
||||
this.set(
|
||||
"chatChannel",
|
||||
ChatChannel.create({
|
||||
chatable_type: "DirectMessageChannel",
|
||||
chatable_type: "DirectMessage",
|
||||
chatable: {
|
||||
users: [{ id: 1 }],
|
||||
},
|
||||
@ -43,7 +43,7 @@ module(
|
||||
this.set(
|
||||
"chatChannel",
|
||||
ChatChannel.create({
|
||||
chatable_type: "DirectMessageChannel",
|
||||
chatable_type: "DirectMessage",
|
||||
chatable: {
|
||||
users: [
|
||||
{ name: "Tomtom" },
|
||||
|
@ -59,7 +59,7 @@ module(
|
||||
async beforeEach() {
|
||||
this.set(
|
||||
"chatChannel",
|
||||
ChatChannel.create({ chatable_type: "DirectMessageChannel" })
|
||||
ChatChannel.create({ chatable_type: "DirectMessage" })
|
||||
);
|
||||
set(this.currentUser, "needs_dm_retention_reminder", true);
|
||||
this.siteSettings.chat_dm_retention_days = 100;
|
||||
@ -79,7 +79,7 @@ module(
|
||||
async beforeEach() {
|
||||
this.set(
|
||||
"chatChannel",
|
||||
ChatChannel.create({ chatable_type: "DirectMessageChannel" })
|
||||
ChatChannel.create({ chatable_type: "DirectMessage" })
|
||||
);
|
||||
set(this.currentUser, "needs_dm_retention_reminder", false);
|
||||
this.siteSettings.chat_dm_retention_days = 100;
|
||||
|
Reference in New Issue
Block a user