From 3b7c469ca4bbbbce11bf370cbbfb42cf087c8994 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 9 Mar 2021 18:58:39 +0100 Subject: [PATCH] Fix the way conversations without name are created --- src/controllers/conversations_controller.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/controllers/conversations_controller.rs b/src/controllers/conversations_controller.rs index 0ea5f5c..82f249d 100644 --- a/src/controllers/conversations_controller.rs +++ b/src/controllers/conversations_controller.rs @@ -32,21 +32,14 @@ use crate::utils::user_data_utils::{delete_user_data_file_if_exists, user_data_p /// Create a new conversation pub fn create(r: &mut HttpRequestHandler) -> RequestResult { - let name = r.post_string("name")?; let mut members = r.post_users_id("users")?; - // Adapt name - let name = match name.as_str() { - "false" => None, - s => Some(s.to_string()) - }; - // Add current user ID if required members.insert(r.user_id()?); let conv = NewConversation { owner_id: r.user_id()?, - name, + name: r.post_string_optional("name"), owner_following: r.post_bool("follow")?, members, can_everyone_add_members: r.post_bool_opt("canEveryoneAddMembers", true),