Skip to content

A platform for community discussion. Free, open, simple.

FIX: correctly check the user id of the original message (#26805)

Joffrey JAFFEUX271ca2c9682e
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-thread-title-prompt.js b/plugins/chat/assets/javascripts/discourse/components/chat-thread-title-prompt.js
index 7e3af0ca180..fcfae6d8b2a 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-thread-title-prompt.js
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-thread-title-prompt.js
@@ -7,7 +7,7 @@ import ThreadSettingsModal from "discourse/plugins/chat/discourse/components/cha
import { THREAD_TITLE_PROMPT_THRESHOLD } from "discourse/plugins/chat/discourse/lib/chat-constants";
import UserChatThreadMembership from "discourse/plugins/chat/discourse/models/user-chat-thread-membership";
-export default class ShowThreadTitlePrompt extends Component {
+export default class ChatThreadTitlePrompt extends Component {
@service chatApi;
@service modal;
@service toasts;
@@ -66,7 +66,7 @@ export default class ShowThreadTitlePrompt extends Component {
get canShowToast() {
if (
this.site.desktopView ||
- (this.args.thread.user_id !== this.currentUser.id &&
+ (this.args.thread.originalMessage?.user?.id !== this.currentUser.id &&
!this.currentUser.admin)
) {
return false;
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-thread.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-thread.gjs
index c5abb5dc289..f0f2bfbf108 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-thread.gjs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-thread.gjs
@@ -12,7 +12,7 @@ import { resetIdle } from "discourse/lib/desktop-notifications";
import { NotificationLevels } from "discourse/lib/notification-levels";
import discourseDebounce from "discourse-common/lib/debounce";
import { bind } from "discourse-common/utils/decorators";
-import ShowThreadTitlePrompt from "discourse/plugins/chat/discourse/components/chat-thread-title-prompt";
+import ChatThreadTitlePrompt from "discourse/plugins/chat/discourse/components/chat-thread-title-prompt";
import firstVisibleMessageId from "discourse/plugins/chat/discourse/helpers/first-visible-message-id";
import ChatChannelThreadSubscriptionManager from "discourse/plugins/chat/discourse/lib/chat-channel-thread-subscription-manager";
import {
@@ -584,7 +584,7 @@ export default class ChatThread extends Component {
{{/if}}
<ChatUploadDropZone @model={{@thread}} />
- <ShowThreadTitlePrompt @thread={{@thread}} />
+ <ChatThreadTitlePrompt @thread={{@thread}} />
</div>
</template>
}