mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-05 18:55:59 +00:00
fix: allow removing channel slowmode (#836)
Signed-off-by: Zomatree <me@zomatree.live>
This commit is contained in:
@@ -161,6 +161,7 @@ auto_derived!(
|
||||
Icon,
|
||||
DefaultPermissions,
|
||||
Voice,
|
||||
Slowmode,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -554,6 +555,12 @@ impl Channel {
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
FieldsChannel::Slowmode => match self {
|
||||
Self::TextChannel { slowmode, .. } => {
|
||||
slowmode.take();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -777,6 +784,7 @@ impl IntoDocumentPath for FieldsChannel {
|
||||
FieldsChannel::Icon => "icon",
|
||||
FieldsChannel::DefaultPermissions => "default_permissions",
|
||||
FieldsChannel::Voice => "voice",
|
||||
FieldsChannel::Slowmode => "slowmode",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,6 +319,7 @@ impl From<FieldsChannel> for crate::FieldsChannel {
|
||||
FieldsChannel::Icon => crate::FieldsChannel::Icon,
|
||||
FieldsChannel::DefaultPermissions => crate::FieldsChannel::DefaultPermissions,
|
||||
FieldsChannel::Voice => crate::FieldsChannel::Voice,
|
||||
FieldsChannel::Slowmode => crate::FieldsChannel::Slowmode,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -330,6 +331,7 @@ impl From<crate::FieldsChannel> for FieldsChannel {
|
||||
crate::FieldsChannel::Icon => FieldsChannel::Icon,
|
||||
crate::FieldsChannel::DefaultPermissions => FieldsChannel::DefaultPermissions,
|
||||
crate::FieldsChannel::Voice => FieldsChannel::Voice,
|
||||
crate::FieldsChannel::Slowmode => FieldsChannel::Slowmode,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +164,7 @@ auto_derived!(
|
||||
Icon,
|
||||
DefaultPermissions,
|
||||
Voice,
|
||||
Slowmode,
|
||||
}
|
||||
|
||||
/// New webhook information
|
||||
|
||||
@@ -221,6 +221,9 @@ pub async fn edit(
|
||||
v0::FieldsChannel::Voice => {
|
||||
voice.take();
|
||||
}
|
||||
v0::FieldsChannel::Slowmode => {
|
||||
slowmode.take();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user