fix(sdk): Remove message contents from TimelineItem debug string
@@ -298,7 +298,7 @@ impl TimelineItemContent {
}
/// An `m.room.message` event or extensible event, including edits.
-#[derive(Clone, Debug)]
+#[derive(Clone)]
pub struct Message {
pub(super) msgtype: MessageType,
// TODO: Add everything required to display the replied-to event, plus a
@@ -332,6 +332,14 @@ impl Message {
}
}
+impl fmt::Debug for Message {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ // since timeline items are logged, don't include all fields here so
+ // people don't leak personal data in bug reports
+ f.debug_struct("Message").field("edited", &self.edited).finish_non_exhaustive()
+ }
+}
+
/// Metadata about an `m.room.encrypted` event that could not be decrypted.
#[derive(Clone, Debug)]
pub enum EncryptedMessage {
