mirror of
				https://gitlab.com/comunic/comunicapiv3
				synced 2025-11-04 09:34:04 +00:00 
			
		
		
		
	Can send new messages
This commit is contained in:
		@@ -16,6 +16,7 @@ use crate::data::config::conf;
 | 
			
		||||
use crate::data::error::{ExecError, ResultBoxError};
 | 
			
		||||
use crate::data::user::UserID;
 | 
			
		||||
use crate::helpers::{account_helper, api_helper, conversations_helper, user_helper};
 | 
			
		||||
use crate::utils::string_utils::remove_html_nodes;
 | 
			
		||||
use crate::utils::user_data_utils::{generate_new_user_data_file_name, prepare_file_creation, user_data_path};
 | 
			
		||||
use crate::utils::virtual_directories_utils::check_virtual_directory;
 | 
			
		||||
 | 
			
		||||
@@ -423,6 +424,11 @@ impl HttpRequestHandler {
 | 
			
		||||
        Ok(dir)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// Get a string included in the request, with HTML codes removed
 | 
			
		||||
    pub fn post_string_without_html(&mut self, name: &str, min_length: usize, required: bool) -> ResultBoxError<String> {
 | 
			
		||||
        Ok(remove_html_nodes(self.post_string_opt(name, min_length, required)?.as_str()))
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// Get & return the ID of the conversation included in the POST request
 | 
			
		||||
    pub fn post_conv_id(&mut self, name: &str) -> ResultBoxError<u64> {
 | 
			
		||||
        let conv_id = self.post_u64(name)?;
 | 
			
		||||
 
 | 
			
		||||
@@ -9,4 +9,5 @@ pub mod user_token;
 | 
			
		||||
pub mod custom_emoji;
 | 
			
		||||
pub mod new_conversation;
 | 
			
		||||
pub mod conversation;
 | 
			
		||||
pub mod conversation_message;
 | 
			
		||||
pub mod conversation_message;
 | 
			
		||||
pub mod new_conversation_message;
 | 
			
		||||
							
								
								
									
										13
									
								
								src/data/new_conversation_message.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/data/new_conversation_message.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
//! # New conversation message
 | 
			
		||||
//!
 | 
			
		||||
//! @author Pierre Hubert
 | 
			
		||||
 | 
			
		||||
use crate::data::user::UserID;
 | 
			
		||||
 | 
			
		||||
/// Information about a new conversation message
 | 
			
		||||
pub struct NewConversationMessage {
 | 
			
		||||
    pub user_id: UserID,
 | 
			
		||||
    pub conv_id: u64,
 | 
			
		||||
    pub message: String,
 | 
			
		||||
    pub image_path: Option<String>
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user