mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 08:55:16 +00:00
Can get a conversation ID from a POST request
This commit is contained in:
@ -77,7 +77,15 @@ pub fn get_list_members(conv_id: u64) -> ResultBoxError<Vec<UserID>> {
|
||||
database::QueryInfo::new(CONV_USERS_TABLE)
|
||||
.cond_u64("conv_id", conv_id)
|
||||
.add_field("user_id")
|
||||
.exec(|res|res.get_user_id("user_id"))
|
||||
.exec(|res| res.get_user_id("user_id"))
|
||||
}
|
||||
|
||||
/// Check if a user belongs to a conversation or not
|
||||
pub fn does_user_belongs_to(user_id: UserID, conv_id: u64) -> ResultBoxError<bool> {
|
||||
Ok(database::QueryInfo::new(CONV_USERS_TABLE)
|
||||
.cond_u64("conv_id", conv_id)
|
||||
.cond_user_id("user_id", user_id)
|
||||
.exec_count()? > 0)
|
||||
}
|
||||
|
||||
/// Turn a database entry into a ConversationInfo object
|
||||
|
Reference in New Issue
Block a user