mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 16:35:17 +00:00
Can make global search
This commit is contained in:
9
src/data/global_search_result.rs
Normal file
9
src/data/global_search_result.rs
Normal file
@ -0,0 +1,9 @@
|
||||
//! # Global search result
|
||||
|
||||
use crate::data::group_id::GroupID;
|
||||
use crate::data::user::UserID;
|
||||
|
||||
pub enum GlobalSearchResult {
|
||||
User(UserID),
|
||||
Group(GroupID),
|
||||
}
|
11
src/data/group.rs
Normal file
11
src/data/group.rs
Normal file
@ -0,0 +1,11 @@
|
||||
//! # Group information
|
||||
//!
|
||||
//! Group visibility level
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
#[derive(Eq, PartialEq, Hash)]
|
||||
pub enum GroupVisibilityLevel {
|
||||
OPEN_GROUP,
|
||||
PRIVATE_GROUP,
|
||||
SECRETE_GROUP,
|
||||
}
|
18
src/data/group_id.rs
Normal file
18
src/data/group_id.rs
Normal file
@ -0,0 +1,18 @@
|
||||
//! # Group ID
|
||||
//!
|
||||
//! @author Pierre Hubert
|
||||
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct GroupID(u64);
|
||||
|
||||
impl GroupID {
|
||||
/// Initialize a new group ID object
|
||||
pub fn new(id: u64) -> GroupID {
|
||||
GroupID(id)
|
||||
}
|
||||
|
||||
/// Get the ID current stored in this structure
|
||||
pub fn id(&self) -> u64 {
|
||||
self.0
|
||||
}
|
||||
}
|
@ -11,4 +11,7 @@ pub mod new_conversation;
|
||||
pub mod conversation;
|
||||
pub mod conversation_message;
|
||||
pub mod new_conversation_message;
|
||||
pub mod unread_conversation;
|
||||
pub mod unread_conversation;
|
||||
pub mod group_id;
|
||||
pub mod group;
|
||||
pub mod global_search_result;
|
Reference in New Issue
Block a user