use std::collections::BTreeMap;
use ruma_macros::EventContent;
use serde::{Deserialize, Serialize};
use super::Relation;
use crate::{serde::Base64, OwnedTransactionId};
#[derive(Clone, Debug, Deserialize, Serialize, EventContent)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
#[ruma_event(type = "m.key.verification.mac", kind = ToDevice)]
pub struct ToDeviceKeyVerificationMacEventContent {
pub transaction_id: OwnedTransactionId,
pub mac: BTreeMap<String, Base64>,
pub keys: Base64,
}
impl ToDeviceKeyVerificationMacEventContent {
pub fn new(
transaction_id: OwnedTransactionId,
mac: BTreeMap<String, Base64>,
keys: Base64,
) -> Self {
Self { transaction_id, mac, keys }
}
}
#[derive(Clone, Debug, Deserialize, Serialize, EventContent)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
#[ruma_event(type = "m.key.verification.mac", kind = MessageLike)]
pub struct KeyVerificationMacEventContent {
pub mac: BTreeMap<String, Base64>,
pub keys: Base64,
#[serde(rename = "m.relates_to")]
pub relates_to: Relation,
}
impl KeyVerificationMacEventContent {
pub fn new(mac: BTreeMap<String, Base64>, keys: Base64, relates_to: Relation) -> Self {
Self { mac, keys, relates_to }
}
}