<commit_before>//! Types for the *m.receipt* event.

use std::collections::HashMap;

use ruma_identifiers::{EventId, RoomId, UserId};

event! {
    /// Informs the client of new receipts.
    pub struct ReceiptEvent(ReceiptEventContent) {
        /// The unique identifier for the room associated with this event.
        pub room_id: RoomId
    }
}

/// The payload of a `ReceiptEvent`.
///
/// A mapping of event ID to a collection of receipts for this event ID. The event ID is the ID of
/// the event being acknowledged and *not* an ID for the receipt itself.
pub type ReceiptEventContent = HashMap<EventId, Receipts>;

/// A collection of receipts.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Receipts {
    /// A collection of users who have sent *m.read* receipts for this event.
    pub m_read: UserReceipts,
}

/// A mapping of user ID to receipt.
///
/// The user ID is the entity who sent this receipt.
pub type UserReceipts = HashMap<UserId, Receipt>;

/// An acknowledgement of an event.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Receipt {
    /// The timestamp the receipt was sent at.
    pub ts: u64,
}<commit_msg>Fix wrong json key in receipt event<commit_after>//! Types for the *m.receipt* event.

use std::collections::HashMap;

use ruma_identifiers::{EventId, RoomId, UserId};

event! {
    /// Informs the client of new receipts.
    pub struct ReceiptEvent(ReceiptEventContent) {
        /// The unique identifier for the room associated with this event.
        pub room_id: RoomId
    }
}

/// The payload of a `ReceiptEvent`.
///
/// A mapping of event ID to a collection of receipts for this event ID. The event ID is the ID of
/// the event being acknowledged and *not* an ID for the receipt itself.
pub type ReceiptEventContent = HashMap<EventId, Receipts>;

/// A collection of receipts.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Receipts {
    /// A collection of users who have sent *m.read* receipts for this event.
    #[serde(rename="m.read")]
    pub m_read: UserReceipts,
}

/// A mapping of user ID to receipt.
///
/// The user ID is the entity who sent this receipt.
pub type UserReceipts = HashMap<UserId, Receipt>;

/// An acknowledgement of an event.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Receipt {
    /// The timestamp the receipt was sent at.
    pub ts: u64,
}
{'fraction_non_alphanumeric': 0.10563973063973064, 'fraction_numerical': 0.0016835016835016834, 'mean_word_length': 3.207079646017699, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5781695', 'n_tokens_mistral': 737, 'n_tokens_neox': 703, 'n_words': 303}