diff --git a/app/templates_src/profile.lisp b/app/templates_src/profile.lisp index f26bd28..15480a0 100644 --- a/app/templates_src/profile.lisp +++ b/app/templates_src/profile.lisp @@ -60,7 +60,7 @@ (div ("class" "card banner") (img - ("src" "{{ config.service_hosts.buckets }}/banners/{{ profile.id }}"))) + ("src" "{{ config.service_hosts.buckets|safe }}/banners/{{ profile.id }}"))) (div ("class" "card flex flex_col gap_ch") (text "{{ components::avatar(id=profile.id, size=\"160px\") }}") diff --git a/src/routes/api/chats.rs b/src/routes/api/chats.rs index 29e8932..c3e8489 100644 --- a/src/routes/api/chats.rs +++ b/src/routes/api/chats.rs @@ -43,6 +43,10 @@ pub async fn create_request( }; req.members.dedup(); + if req.members.contains(&user.username) { + return Json(Error::MiscError("Cannot create a chat with yourself".to_string()).into()); + } + if (req.members.len() > 2 && req.style == ChatStyle::Direct) | (req.members.len() >= GC_MAXIMUM_MEMBERS && req.style != ChatStyle::Direct) {