1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-22 21:39:21 +00:00
comunicapiv3/src/data/new_conversation_message.rs

29 lines
856 B
Rust

//! # New conversation message
//!
//! @author Pierre Hubert
use crate::data::user::UserID;
use crate::data::conversation::ConvID;
use crate::data::conversation_message::{ConversationMessageFile, ConversationServerMessageType};
/// Information about a new conversation message
pub struct NewConversationMessage {
pub user_id: Option<UserID>,
pub conv_id: ConvID,
pub message: Option<String>,
pub file: Option<ConversationMessageFile>,
pub server_message: Option<ConversationServerMessageType>,
}
impl NewConversationMessage {
/// Create a new server message
pub fn new_server_message(conv_id: ConvID, message: ConversationServerMessageType) -> Self {
Self {
user_id: None,
conv_id,
message: None,
file: None,
server_message: Some(message),
}
}
}