Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export class WebhookController {
}

if (localId) {
local.data.text = local.data.text ?? "";
const post = await this.postsService.findById(localId);
if (!post) return res.status(500).send();
for (const key of Object.keys(local.data)) {
Expand All @@ -188,6 +189,7 @@ export class WebhookController {
await this.postsService.postRepository.save(post);
} else {
console.log("Creating new post");
local.data.text = local.data.text ?? "";
const post = await this.postsService.createPost(
author?.id as string,
// @ts-ignore
Expand Down Expand Up @@ -246,7 +248,7 @@ export class WebhookController {
// Check for existing DM (2 participants, no name) before creating
const participantIds = participants.map((p) => p.id);
const isDM = participantIds.length === 2 && !local.data.name;

let chat;
if (isDM) {
const existingChat = await this.chatService.findChatByParticipants(participantIds);
Expand Down