From edc67d424bd7610abda3fffa0979061e7fa9cfcb Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Tue, 29 Nov 2022 13:26:58 -0300 Subject: [PATCH] Fix quote --- app/lib/database/model/Message.js | 2 ++ app/lib/database/model/Thread.js | 1 + app/lib/database/model/ThreadMessage.js | 1 + app/lib/methods/getPermalinks.ts | 7 +++---- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/lib/database/model/Message.js b/app/lib/database/model/Message.js index 6016c3ebd..5e452b43c 100644 --- a/app/lib/database/model/Message.js +++ b/app/lib/database/model/Message.js @@ -88,6 +88,8 @@ export default class Message extends Model { asPlain() { return { + id: this.id, + rid: this.subscription.id, msg: this.msg, t: this.t, ts: this.ts, diff --git a/app/lib/database/model/Thread.js b/app/lib/database/model/Thread.js index a5c4ef27b..947493b6b 100644 --- a/app/lib/database/model/Thread.js +++ b/app/lib/database/model/Thread.js @@ -80,6 +80,7 @@ export default class Thread extends Model { asPlain() { return { + id: this.id, msg: this.msg, t: this.t, ts: this.ts, diff --git a/app/lib/database/model/ThreadMessage.js b/app/lib/database/model/ThreadMessage.js index f2f311ace..0d2ad16bf 100644 --- a/app/lib/database/model/ThreadMessage.js +++ b/app/lib/database/model/ThreadMessage.js @@ -80,6 +80,7 @@ export default class ThreadMessage extends Model { asPlain() { return { + id: this.id, msg: this.msg, t: this.t, ts: this.ts, diff --git a/app/lib/methods/getPermalinks.ts b/app/lib/methods/getPermalinks.ts index b85571159..0f28ff108 100644 --- a/app/lib/methods/getPermalinks.ts +++ b/app/lib/methods/getPermalinks.ts @@ -1,16 +1,15 @@ import log from './helpers/log'; -import { TMessageModel, TSubscriptionModel } from '../../definitions'; +import { IMessage, TSubscriptionModel } from '../../definitions'; import { store } from '../store/auxStore'; import { isGroupChat } from './helpers'; import { getRoom } from './getRoom'; type TRoomType = 'p' | 'c' | 'd'; -export async function getPermalinkMessage(message: TMessageModel): Promise { - if (!message.subscription) return null; +export async function getPermalinkMessage(message: IMessage): Promise { let room: TSubscriptionModel; try { - room = await getRoom(message.subscription.id); + room = await getRoom(message.rid); } catch (e) { log(e); return null;