fix(api): correct timestamp usage (#67)

This commit is contained in:
Hampus 2026-01-07 15:16:28 +01:00 committed by GitHub
parent 056d578965
commit 288477a5b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 4 deletions

View File

@ -26,7 +26,7 @@ export class CallInfo {
constructor(call: MessageCall) {
this.participantIds = call.participant_ids ?? new Set();
this.endedTimestamp = call.ended_timestamp ?? null;
this.endedTimestamp = call.ended_timestamp ? new Date(call.ended_timestamp) : null;
}
toMessageCall(): MessageCall {

View File

@ -45,7 +45,7 @@ export class Embed {
this.title = embed.title ?? null;
this.description = embed.description ?? null;
this.url = embed.url ?? null;
this.timestamp = embed.timestamp ?? null;
this.timestamp = embed.timestamp ? new Date(embed.timestamp) : null;
this.color = embed.color ?? null;
this.author = embed.author ? new EmbedAuthor(embed.author) : null;
this.provider = embed.provider ? new EmbedProvider(embed.provider) : null;

View File

@ -38,8 +38,8 @@ export class MessageSnapshot {
constructor(snapshot: CassandraMessageSnapshot) {
this.content = snapshot.content ?? null;
this.timestamp = snapshot.timestamp;
this.editedTimestamp = snapshot.edited_timestamp ?? null;
this.timestamp = new Date(snapshot.timestamp);
this.editedTimestamp = snapshot.edited_timestamp ? new Date(snapshot.edited_timestamp) : null;
this.mentionedUserIds = snapshot.mention_users ?? new Set();
this.mentionedRoleIds = snapshot.mention_roles ?? new Set();
this.mentionedChannelIds = snapshot.mention_channels ?? new Set();

View File

@ -0,0 +1 @@
ALTER TYPE fluxer.message_snapshot ADD edited_timestamp timestamp;