diff --git a/plugins/chat/app/controllers/chat/api/chatables_controller.rb b/plugins/chat/app/controllers/chat/api/chatables_controller.rb index c58a4796456..8454b74be9a 100644 --- a/plugins/chat/app/controllers/chat/api/chatables_controller.rb +++ b/plugins/chat/app/controllers/chat/api/chatables_controller.rb @@ -42,7 +42,7 @@ class Chat::Api::ChatablesController < Chat::ApiController direct_message_channels = if users.count > 0 # FIXME: investigate the cost of this query - Chat::Channel + Chat::DirectMessageChannel .includes(chatable: :users) .joins(direct_message: :direct_message_users) .group(1) diff --git a/plugins/chat/app/serializers/chat/direct_message_serializer.rb b/plugins/chat/app/serializers/chat/direct_message_serializer.rb index 6cc97f22c8a..95aa9fca6e8 100644 --- a/plugins/chat/app/serializers/chat/direct_message_serializer.rb +++ b/plugins/chat/app/serializers/chat/direct_message_serializer.rb @@ -2,6 +2,8 @@ module Chat class DirectMessageSerializer < ApplicationSerializer + attributes :id + has_many :users, serializer: Chat::UserWithCustomFieldsAndStatusSerializer, embed: :objects def users diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-modal-inner.js b/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-modal-inner.js index 5519e771f2e..17d9420f1d1 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-modal-inner.js +++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-modal-inner.js @@ -40,7 +40,7 @@ export default Component.extend(ModalFunctionality, { .createChannelArchive(this.chatChannel.id, this._data()) .then(() => { this.flash(I18n.t("chat.channel_archive.process_started"), "success"); - this.chatChannel.set("status", CHANNEL_STATUSES.archived); + this.chatChannel.status = CHANNEL_STATUSES.archived; discourseLater(() => { this.closeModal(); diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-status.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-status.hbs index e09696ee388..745fb8907b6 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-status.hbs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-archive-status.hbs @@ -1,18 +1,25 @@ -{{#if (and this.channel.archive_failed this.currentUser.admin)}} -
@@ -102,12 +106,12 @@