WIP: Audit Logs #45

Draft
baaboe wants to merge 13 commits from wip/auditlog into main
2 changed files with 5 additions and 1 deletions
Showing only changes of commit 362e4bc2e8 - Show all commits

View file

@ -115,12 +115,15 @@ pub async fn patch(
.await?;
if let Some(new_name) = &new_info.name {
let log_entrie = AuditLog::new(channel.guild_uuid, AuditLogId::ChannelUpdateName as i16, member.uuid, Some(channel_uuid), None, None, None, None, Some(channel.name.clone()), Some(new_name.clone())).await;
channel
.set_name(&mut conn, &app_state.cache_pool, new_name.to_string())
.await?;
log_entrie.push(&mut conn).await?;
}
if let Some(new_description) = &new_info.description {
let log_entrie = AuditLog::new(channel.guild_uuid, AuditLogId::ChannelUpdateDescripiton as i16, member.uuid, Some(channel_uuid), None, None, None, None, Some(channel.description.clone().unwrap_or("".to_string())), Some(new_description.clone())).await;
channel
.set_description(
&mut conn,
@ -128,6 +131,7 @@ pub async fn patch(
new_description.to_string(),
)
.await?;
log_entrie.push(&mut conn).await?;
}
if let Some(new_is_above) = &new_info.is_above {

View file

@ -53,7 +53,7 @@ pub struct Channel {
pub uuid: Uuid,
pub guild_uuid: Uuid,
pub name: String,
description: Option<String>,
pub description: Option<String>,
pub is_above: Option<Uuid>,
pub permissions: Vec<ChannelPermission>,
}