Skip to content

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

DEV: Get rid of old chat TODOs (#22324)

Martin Brennanc4c566846d11
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel.js b/plugins/chat/assets/javascripts/discourse/components/chat-channel.js
index f3c58b77f48..63c0f19a634 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel.js
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel.js
@@ -674,8 +674,6 @@ export default class ChatLivePane extends Component {
}
}
- // TODO (martin) Maybe change this to public, since its referred to by
- // livePanel.linkedComponent at the moment.
get _selfDeleted() {
return this.isDestroying || this.isDestroyed;
}
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-thread.js b/plugins/chat/assets/javascripts/discourse/components/chat-thread.js
index 48ba6eb2d40..a471d27c71c 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-thread.js
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-thread.js
@@ -63,8 +63,6 @@ export default class ChatThreadPanel extends Component {
this.chatThreadPaneSubscriptionsManager.unsubscribe();
}
- // TODO (martin) This needs to have the extended scroll/message visibility/
- // mark read behaviour the same as the channel.
@action
computeScrollState() {
cancel(this.onScrollEndedHandler);
@@ -115,7 +113,7 @@ export default class ChatThreadPanel extends Component {
return;
}
- // TODO (martin) HACK: We don't have proper scroll visibility over
+ // HACK: We don't have proper scroll visibility over
// what message we are looking at, don't have the lastReadMessageId
// for the thread, and this updateLastReadMessage function is only
// called when scrolling all the way to the bottom.
diff --git a/plugins/chat/assets/javascripts/discourse/services/chat-api.js b/plugins/chat/assets/javascripts/discourse/services/chat-api.js
index 0d4be6ba794..421584e5e61 100644
--- a/plugins/chat/assets/javascripts/discourse/services/chat-api.js
+++ b/plugins/chat/assets/javascripts/discourse/services/chat-api.js
@@ -321,7 +321,6 @@ export default class ChatApi extends Service {
* @returns {Promise}
*/
saveDraft(channelId, data) {
- // TODO (martin) Change this to postRequest after moving DraftsController into Api::DraftsController
return ajax("/chat/drafts", {
type: "POST",
data: {
@@ -351,7 +350,6 @@ export default class ChatApi extends Service {
* @returns {Promise}
*/
publishReaction(channelId, messageId, emoji, reactAction) {
- // TODO (martin) Not ideal, this should have a chat API controller endpoint.
return ajax(`/chat/${channelId}/react/${messageId}`, {
type: "PUT",
data: {
@@ -380,7 +378,6 @@ export default class ChatApi extends Service {
* @param {number} messageId - The ID of the message being restored.
*/
rebakeMessage(channelId, messageId) {
- // TODO (martin) Not ideal, this should have a chat API controller endpoint.
return ajax(`/chat/${channelId}/${messageId}/rebake`, {
type: "PUT",
});
@@ -396,7 +393,6 @@ export default class ChatApi extends Service {
* @param {Array<number>} data.upload_ids - The uploads attached to the message after editing.
*/
editMessage(channelId, messageId, data) {
- // TODO (martin) Not ideal, this should have a chat API controller endpoint.
return ajax(`/chat/${channelId}/edit/${messageId}`, {
type: "PUT",
data,
diff --git a/plugins/chat/assets/javascripts/discourse/services/chat-channel-pane-subscriptions-manager.js b/plugins/chat/assets/javascripts/discourse/services/chat-channel-pane-subscriptions-manager.js
index a0acf760275..6604c7e1c0d 100644
--- a/plugins/chat/assets/javascripts/discourse/services/chat-channel-pane-subscriptions-manager.js
+++ b/plugins/chat/assets/javascripts/discourse/services/chat-channel-pane-subscriptions-manager.js
@@ -14,9 +14,6 @@ export default class ChatChannelPaneSubscriptionsManager extends ChatPaneBaseSub
return this.model.channelMessageBusLastId;
}
- // TODO (martin) Implement this for the channel, since it involves a bunch
- // of scrolling and pane-specific logic. Will leave the existing sub inside
- // ChatLivePane for now.
handleSentMessage() {
return;
}
diff --git a/plugins/chat/assets/javascripts/discourse/services/chat-pane-base-subscriptions-manager.js b/plugins/chat/assets/javascripts/discourse/services/chat-pane-base-subscriptions-manager.js
index 6967c394557..f9f453d25cc 100644
--- a/plugins/chat/assets/javascripts/discourse/services/chat-pane-base-subscriptions-manager.js
+++ b/plugins/chat/assets/javascripts/discourse/services/chat-pane-base-subscriptions-manager.js
@@ -4,8 +4,6 @@ import ChatMessageMentionWarning from "discourse/plugins/chat/discourse/models/c
import { cloneJSON } from "discourse-common/lib/object";
import { bind } from "discourse-common/utils/decorators";
-// TODO (martin) This export can be removed once we move the handleSentMessage
-// code completely out of ChatLivePane
export function handleStagedMessage(channel, messagesManager, data) {
const stagedMessage = messagesManager.findStagedMessage(data.staged_id);
@@ -72,8 +70,6 @@ export default class ChatPaneBaseSubscriptionsManager extends Service {
this.model = null;
}
- // TODO (martin) This can be removed once we move the handleSentMessage
- // code completely out of ChatLivePane
handleStagedMessageInternal(channel, data) {
return handleStagedMessage(channel, this.messagesManager, data);
}