mirror of
https://github.com/discourse/discourse.git
synced 2024-12-22 12:03:51 +08:00
a460dbcb37
This feature adds the functionality to start a new chat directly from the URL using query params. The format is: /chat/new-message?recipients=buford,jona The initial version of this feature allows for the following: - Open an existing direct message channel with a single user - Create a new direct message channel with a single user (and auto redirect) - Create or open a channel with multiple users (and auto redirect) - Redirects to chat home if the recipients param is missing
38 lines
1.0 KiB
JavaScript
38 lines
1.0 KiB
JavaScript
export default function () {
|
|
this.route("chat", function () {
|
|
this.route("channel", { path: "/c/:channelTitle/:channelId" }, function () {
|
|
this.route("near-message", { path: "/:messageId" });
|
|
this.route("near-message-with-thread", {
|
|
path: "/:messageId/t/:threadId",
|
|
});
|
|
this.route("threads", { path: "/t" });
|
|
this.route("thread", { path: "/t/:threadId" }, function () {
|
|
this.route("near-message", { path: "/:messageId" });
|
|
});
|
|
});
|
|
|
|
this.route("direct-messages");
|
|
this.route("channels");
|
|
this.route("threads");
|
|
|
|
this.route("new-message");
|
|
|
|
this.route(
|
|
"channel.info",
|
|
{ path: "/c/:channelTitle/:channelId/info" },
|
|
function () {
|
|
this.route("members");
|
|
this.route("settings");
|
|
}
|
|
);
|
|
|
|
this.route("browse", function () {
|
|
this.route("all");
|
|
this.route("closed");
|
|
this.route("open");
|
|
this.route("archived");
|
|
});
|
|
this.route("message", { path: "/message/:messageId" });
|
|
});
|
|
}
|