Skip to content
Snippets Groups Projects
Verified Commit ee5c4fc3 authored by insert's avatar insert
Browse files

Add route which wasn't declared, fix send message.

parent 35623452
Branches
Tags
No related merge requests found
......@@ -155,6 +155,15 @@ pub fn send_message(user: User, target: Channel, message: Json<SendMessage>) ->
None
) {
Ok(_) => {
if target.channel_type == ChannelType::DM as u8 {
let col = database::get_collection("channels");
col.update_one(
doc! { "_id": target.id.clone() },
doc! { "active": true },
None
).unwrap();
}
websocket::queue_message(
get_recipients(&target),
json!({
......
......@@ -10,5 +10,5 @@ pub fn mount(rocket: Rocket) -> Rocket {
.mount("/api", routes![ root::root ])
.mount("/api/account", routes![ account::create, account::verify_email, account::resend_email, account::login, account::token ])
.mount("/api/users", routes![ user::me, user::user, user::lookup, user::dms, user::dm, user::get_friends, user::get_friend, user::add_friend, user::remove_friend ])
.mount("/api/channels", routes![ channel::channel, channel::delete, channel::messages, channel::send_message, channel::edit_message, channel::delete_message ])
.mount("/api/channels", routes![ channel::channel, channel::delete, channel::messages, channel::get_message, channel::send_message, channel::edit_message, channel::delete_message ])
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment