Skip to content

Commit

Permalink
runfix: set creation message timestamp to 0 after clearing content (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrykBuniX authored Jan 18, 2024
1 parent b01fc41 commit d4a285f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/script/conversation/ConversationRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2255,7 +2255,7 @@ export class ConversationRepository {
*/
private async clearConversationContent(conversation: Conversation, timestamp: number) {
await this.deleteMessages(conversation, timestamp);
await this.addCreationMessage(conversation, !!this.userState.self()?.isTemporaryGuest(), timestamp);
await this.addCreationMessage(conversation, !!this.userState.self()?.isTemporaryGuest());
conversation.setTimestamp(timestamp, Conversation.TIMESTAMP_TYPE.CLEARED);
}

Expand Down
4 changes: 2 additions & 2 deletions src/script/conversation/EventBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,11 @@ export const EventBuilder = {
buildGroupCreation(
conversationEntity: Conversation,
isTemporaryGuest: boolean = false,
timestamp: number,
timestamp: number = 0,
): GroupCreationEvent {
const {creator: creatorId} = conversationEntity;
const selfUserId = conversationEntity.selfUser().id;
const isoDate = new Date(timestamp || 0).toISOString();
const isoDate = new Date(timestamp).toISOString();

const userIds = conversationEntity.participating_user_ids().slice();
const createdBySelf = creatorId === selfUserId || isTemporaryGuest;
Expand Down

0 comments on commit d4a285f

Please sign in to comment.