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

29 lines
856 B
Rust
Raw Normal View History

2020-06-22 10:19:13 +00:00
//! # New conversation message
//!
//! @author Pierre Hubert
use crate::data::user::UserID;
2021-03-04 17:51:52 +00:00
use crate::data::conversation::ConvID;
use crate::data::conversation_message::{ConversationMessageFile, ConversationServerMessageType};
2020-06-22 10:19:13 +00:00
/// Information about a new conversation message
pub struct NewConversationMessage {
2021-03-04 17:51:52 +00:00
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),
}
}
2020-06-22 10:19:13 +00:00
}