Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

feat: add fallbacks to all the supported content types #25

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/gorgeous-pugs-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@xmtp/content-type-remote-attachment": minor
"@xmtp/content-type-read-receipt": minor
"@xmtp/content-type-reaction": minor
"@xmtp/content-type-reply": minor
---

Add dummy fallback field to all content types
4 changes: 4 additions & 0 deletions packages/content-type-reaction/src/Reaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,8 @@ export class ReactionCodec implements ContentCodec<Reaction> {
content: new TextDecoder().decode(content.content),
};
}

fallback(): string | undefined {
return "Error: Sorry, this app cannot display reactions";
}
}
4 changes: 4 additions & 0 deletions packages/content-type-read-receipt/src/ReadReceipt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ export class ReadReceiptCodec implements ContentCodec<ReadReceipt> {
timestamp,
};
}

fallback(): string | undefined {
return undefined;
}
}
4 changes: 4 additions & 0 deletions packages/content-type-remote-attachment/src/Attachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ export class AttachmentCodec implements ContentCodec<Attachment> {
data: content.content,
};
}

fallback(): string | undefined {
return "Error: Sorry, this app cannot display attachments";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,8 @@ export class RemoteAttachmentCodec implements ContentCodec<RemoteAttachment> {
filename: content.parameters.filename,
};
}

fallback(): string | undefined {
return "Error: Sorry, this app cannot display attachments";
}
}
4 changes: 4 additions & 0 deletions packages/content-type-reply/src/Reply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@ export class ReplyCodec implements ContentCodec<Reply> {
content: codec.decode(decodedContent as EncodedContent, codecs),
};
}

fallback(): string | undefined {
return "Error: Sorry, this app cannot display quote replies";
}
}
Loading