Fix quote
This commit is contained in:
parent
fad04765d4
commit
edc67d424b
|
@ -88,6 +88,8 @@ export default class Message extends Model {
|
||||||
|
|
||||||
asPlain() {
|
asPlain() {
|
||||||
return {
|
return {
|
||||||
|
id: this.id,
|
||||||
|
rid: this.subscription.id,
|
||||||
msg: this.msg,
|
msg: this.msg,
|
||||||
t: this.t,
|
t: this.t,
|
||||||
ts: this.ts,
|
ts: this.ts,
|
||||||
|
|
|
@ -80,6 +80,7 @@ export default class Thread extends Model {
|
||||||
|
|
||||||
asPlain() {
|
asPlain() {
|
||||||
return {
|
return {
|
||||||
|
id: this.id,
|
||||||
msg: this.msg,
|
msg: this.msg,
|
||||||
t: this.t,
|
t: this.t,
|
||||||
ts: this.ts,
|
ts: this.ts,
|
||||||
|
|
|
@ -80,6 +80,7 @@ export default class ThreadMessage extends Model {
|
||||||
|
|
||||||
asPlain() {
|
asPlain() {
|
||||||
return {
|
return {
|
||||||
|
id: this.id,
|
||||||
msg: this.msg,
|
msg: this.msg,
|
||||||
t: this.t,
|
t: this.t,
|
||||||
ts: this.ts,
|
ts: this.ts,
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
import log from './helpers/log';
|
import log from './helpers/log';
|
||||||
import { TMessageModel, TSubscriptionModel } from '../../definitions';
|
import { IMessage, TSubscriptionModel } from '../../definitions';
|
||||||
import { store } from '../store/auxStore';
|
import { store } from '../store/auxStore';
|
||||||
import { isGroupChat } from './helpers';
|
import { isGroupChat } from './helpers';
|
||||||
import { getRoom } from './getRoom';
|
import { getRoom } from './getRoom';
|
||||||
|
|
||||||
type TRoomType = 'p' | 'c' | 'd';
|
type TRoomType = 'p' | 'c' | 'd';
|
||||||
|
|
||||||
export async function getPermalinkMessage(message: TMessageModel): Promise<string | null> {
|
export async function getPermalinkMessage(message: IMessage): Promise<string | null> {
|
||||||
if (!message.subscription) return null;
|
|
||||||
let room: TSubscriptionModel;
|
let room: TSubscriptionModel;
|
||||||
try {
|
try {
|
||||||
room = await getRoom(message.subscription.id);
|
room = await getRoom(message.rid);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(e);
|
log(e);
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue