Add a From SecretName implementation for GlobalAccountDataEventType
The secret names are reused as event types for the account data events which get uploaded as part of the secret storage key/value store.
This commit is contained in:
parent
4ef6d1641b
commit
7474f3e9ef
@ -6,7 +6,7 @@ use ruma_common::{serde::StringEnum, OwnedDeviceId, OwnedTransactionId};
|
||||
use ruma_macros::EventContent;
|
||||
use serde::{ser::SerializeStruct, Deserialize, Serialize};
|
||||
|
||||
use crate::PrivOwnedStr;
|
||||
use crate::{GlobalAccountDataEventType, PrivOwnedStr};
|
||||
|
||||
/// The content of an `m.secret.request` event.
|
||||
///
|
||||
@ -133,6 +133,12 @@ pub enum SecretName {
|
||||
_Custom(PrivOwnedStr),
|
||||
}
|
||||
|
||||
impl From<SecretName> for GlobalAccountDataEventType {
|
||||
fn from(value: SecretName) -> Self {
|
||||
GlobalAccountDataEventType::from(value.as_str())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use assert_matches2::assert_matches;
|
||||
|
Loading…
x
Reference in New Issue
Block a user