Skip to content

Commit

Permalink
sms
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman committed Dec 7, 2023
1 parent 1870f7d commit d892378
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 29 deletions.
12 changes: 1 addition & 11 deletions apps/meteor/app/livechat/imports/server/rest/sms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ import { settings } from '../../../../settings/server';
import type { ILivechatMessage } from '../../../server/lib/LivechatTyped';
import { Livechat as LivechatTyped } from '../../../server/lib/LivechatTyped';

type UploadedFile = {
_id: string;
name?: string;
type?: string;
size?: number;
description?: string;
identify?: { size: { width: number; height: number } };
format?: string;
};

const logger = new Logger('SMS');

const getUploadFile = async (details: Omit<IUpload, '_id'>, fileUrl: string) => {
Expand Down Expand Up @@ -134,7 +124,7 @@ API.v1.addRoute('livechat/sms-incoming/:service', {
await LivechatTyped.getRoom(visitor, { rid, token, msg: '' }, roomInfo, undefined);
}

let file: UploadedFile | undefined;
let file: ILivechatMessage['file'];
const attachments: (MessageAttachment | undefined)[] = [];

const [media] = sms?.media || [];
Expand Down
30 changes: 12 additions & 18 deletions apps/meteor/app/livechat/server/lib/LivechatTyped.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,29 +103,23 @@ type OfflineMessageData = {
host?: string;
};

type UploadedFile = {
_id: string;
name?: string;
type?: string;
size?: number;
description?: string;
identify?: { size: { width: number; height: number } };
format?: string;
};

export interface ILivechatMessage {
token: string;
_id: string;
rid: string;
msg: string;
file?: {
_id: string;
name?: string;
type?: string;
size?: number;
description?: string;
identify?: { size: { width: number; height: number } };
format?: string;
};
files?: {
_id: string;
name?: string;
type?: string;
size?: number;
description?: string;
identify?: { size: { width: number; height: number } };
format?: string;
}[];
file?: UploadedFile;
files?: UploadedFile[];
attachments?: MessageAttachment[];
alias?: string;
groupable?: boolean;
Expand Down

0 comments on commit d892378

Please sign in to comment.