discourse/plugins/chat/assets/javascripts/discourse/chat-route-map.js
David Battersby a460dbcb37
FEATURE: Create a link to start a new chat (#25722)
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
2024-02-20 18:08:57 +08:00

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" });
});
}