mirror of
https://github.com/discourse/discourse.git
synced 2025-03-04 10:19:40 +00:00
DEV: removes deprecated code (#23183)
This commit is contained in:
parent
0afddca0b9
commit
2d8a38f883
@ -1,10 +1,5 @@
|
|||||||
export default function () {
|
export default function () {
|
||||||
this.route("chat", { path: "/chat" }, function () {
|
this.route("chat", { path: "/chat" }, function () {
|
||||||
// TODO(roman): Remove after the 3.1 release
|
|
||||||
this.route("channel-legacy", {
|
|
||||||
path: "/channel/:channelId/:channelTitle",
|
|
||||||
});
|
|
||||||
|
|
||||||
this.route("channel", { path: "/c/:channelTitle/:channelId" }, function () {
|
this.route("channel", { path: "/c/:channelTitle/:channelId" }, function () {
|
||||||
this.route("near-message", { path: "/:messageId" });
|
this.route("near-message", { path: "/:messageId" });
|
||||||
this.route("threads", { path: "/t" });
|
this.route("threads", { path: "/t" });
|
||||||
|
@ -31,19 +31,10 @@ export default function withChatChannel(extendedClass) {
|
|||||||
return this.router.replaceWith("chat");
|
return this.router.replaceWith("chat");
|
||||||
}
|
}
|
||||||
|
|
||||||
let { messageId, channelTitle } = this.paramsFor(this.routeName);
|
let { channelTitle } = this.paramsFor(this.routeName);
|
||||||
|
|
||||||
// messageId query param backwards-compatibility
|
|
||||||
if (messageId) {
|
|
||||||
this.router.replaceWith(
|
|
||||||
"chat.channel",
|
|
||||||
...model.routeModels,
|
|
||||||
messageId
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (channelTitle && channelTitle !== model.slugifiedTitle) {
|
if (channelTitle && channelTitle !== model.slugifiedTitle) {
|
||||||
messageId = this.paramsFor("chat.channel.near-message").messageId;
|
const messageId = this.paramsFor("chat.channel.near-message").messageId;
|
||||||
const threadId = this.paramsFor("chat.channel.thread").threadId;
|
const threadId = this.paramsFor("chat.channel.thread").threadId;
|
||||||
|
|
||||||
if (threadId) {
|
if (threadId) {
|
||||||
|
@ -44,19 +44,9 @@ module Chat
|
|||||||
build_summary_for(user)
|
build_summary_for(user)
|
||||||
@preferences_path = "#{Discourse.base_url}/my/preferences/chat"
|
@preferences_path = "#{Discourse.base_url}/my/preferences/chat"
|
||||||
|
|
||||||
# TODO(roman): Remove after the 2.9 release
|
|
||||||
add_unsubscribe_link = UnsubscribeKey.respond_to?(:get_unsubscribe_strategy_for)
|
|
||||||
|
|
||||||
if add_unsubscribe_link
|
|
||||||
unsubscribe_key = UnsubscribeKey.create_key_for(@user, "chat_summary")
|
|
||||||
@unsubscribe_link = "#{Discourse.base_url}/email/unsubscribe/#{unsubscribe_key}"
|
|
||||||
opts[:unsubscribe_url] = @unsubscribe_link
|
|
||||||
end
|
|
||||||
|
|
||||||
opts = {
|
opts = {
|
||||||
from_alias: I18n.t("user_notifications.chat_summary.from", site_name: Email.site_title),
|
from_alias: I18n.t("user_notifications.chat_summary.from", site_name: Email.site_title),
|
||||||
subject: summary_subject(user, @grouped_messages),
|
subject: summary_subject(user, @grouped_messages),
|
||||||
add_unsubscribe_link: add_unsubscribe_link,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build_email(user.email, opts)
|
build_email(user.email, opts)
|
||||||
|
@ -425,7 +425,6 @@ after_initialize do
|
|||||||
end
|
end
|
||||||
|
|
||||||
on(:category_updated) do |category|
|
on(:category_updated) do |category|
|
||||||
# TODO(roman): remove early return after 2.9 release.
|
|
||||||
# There's a bug on core where this event is triggered with an `#update` result (true/false)
|
# There's a bug on core where this event is triggered with an `#update` result (true/false)
|
||||||
if category.is_a?(Category) && category_channel = Chat::Channel.find_by(chatable: category)
|
if category.is_a?(Category) && category_channel = Chat::Channel.find_by(chatable: category)
|
||||||
if category_channel.auto_join_users
|
if category_channel.auto_join_users
|
||||||
|
Loading…
x
Reference in New Issue
Block a user