Skip to content

Commit

Permalink
Merge branch 'develop' into feat/single-contact-id
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris authored Oct 14, 2024
2 parents 130e619 + 8f71f78 commit cf84c57
Show file tree
Hide file tree
Showing 53 changed files with 3,329 additions and 1,464 deletions.
5 changes: 5 additions & 0 deletions .changeset/e2ee-composer-freeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fixes E2EE composer freezing when the room state changes
1 change: 1 addition & 0 deletions apps/meteor/app/apps/server/bridges/livechat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export class AppLivechatBridge extends LivechatBridge {
sidebarIcon: source.sidebarIcon,
defaultIcon: source.defaultIcon,
label: source.label,
destination: source.destination,
}),
},
},
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/app/apps/server/converters/visitors.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class AppVisitorsConverter {
visitorEmails: 'visitorEmails',
livechatData: 'livechatData',
status: 'status',
contactId: 'contactId',
};

return transformMappedData(visitor, map);
Expand All @@ -54,6 +55,7 @@ export class AppVisitorsConverter {
phone: visitor.phone,
livechatData: visitor.livechatData,
status: visitor.status || 'online',
contactId: visitor.contactId,
...(visitor.visitorEmails && { visitorEmails: visitor.visitorEmails }),
...(visitor.department && { department: visitor.department }),
};
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/app/importer-csv/server/CsvImporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { Random } from '@rocket.chat/random';
import { parse } from 'csv-parse/lib/sync';

import { Importer, ProgressStep, ImporterWebsocket } from '../../importer/server';
import type { IConverterOptions } from '../../importer/server/classes/ImportDataConverter';
import type { ConverterOptions } from '../../importer/server/classes/ImportDataConverter';
import type { ImporterProgress } from '../../importer/server/classes/ImporterProgress';
import type { ImporterInfo } from '../../importer/server/definitions/ImporterInfo';
import { notifyOnSettingChanged } from '../../lib/server/lib/notifyListener';

export class CsvImporter extends Importer {
private csvParser: (csv: string) => string[];

constructor(info: ImporterInfo, importRecord: IImport, converterOptions: IConverterOptions = {}) {
constructor(info: ImporterInfo, importRecord: IImport, converterOptions: ConverterOptions = {}) {
super(info, importRecord, converterOptions);

this.csvParser = parse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs';
import path from 'path';
import { Readable } from 'stream';

import { Settings } from '@rocket.chat/models';
import { ImportData, Settings } from '@rocket.chat/models';
import { Meteor } from 'meteor/meteor';

import { Importer, ProgressStep } from '../../importer/server';
Expand Down Expand Up @@ -89,6 +89,13 @@ export class HipChatEnterpriseImporter extends Importer {
await super.addCountToTotal(count);
}

async findDMForImportedUsers(...users) {
const record = await ImportData.findDMForImportedUsers(...users);
if (record) {
return record.data;
}
}

async prepareUserMessagesFile(file) {
this.logger.debug(`preparing room with ${file.length} messages `);
let count = 0;
Expand All @@ -110,7 +117,7 @@ export class HipChatEnterpriseImporter extends Importer {
const users = [senderId, receiverId].sort();

if (!dmRooms[receiverId]) {
dmRooms[receiverId] = await this.converter.findDMForImportedUsers(senderId, receiverId);
dmRooms[receiverId] = await this.findDMForImportedUsers(senderId, receiverId);

if (!dmRooms[receiverId]) {
const room = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { Random } from '@rocket.chat/random';

import { FileUpload } from '../../file-upload/server';
import { Importer, ProgressStep, Selection } from '../../importer/server';
import type { IConverterOptions } from '../../importer/server/classes/ImportDataConverter';
import type { ConverterOptions } from '../../importer/server/classes/ImportDataConverter';
import type { ImporterProgress } from '../../importer/server/classes/ImporterProgress';
import type { ImporterInfo } from '../../importer/server/definitions/ImporterInfo';

export class PendingFileImporter extends Importer {
constructor(info: ImporterInfo, importRecord: IImport, converterOptions: IConverterOptions = {}) {
constructor(info: ImporterInfo, importRecord: IImport, converterOptions: ConverterOptions = {}) {
super(info, importRecord, converterOptions);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { parse } from 'csv-parse/lib/sync';

import { RocketChatFile } from '../../file/server';
import { Importer, ProgressStep } from '../../importer/server';
import type { IConverterOptions } from '../../importer/server/classes/ImportDataConverter';
import type { ConverterOptions } from '../../importer/server/classes/ImportDataConverter';
import type { ImporterProgress } from '../../importer/server/classes/ImporterProgress';
import type { ImporterInfo } from '../../importer/server/definitions/ImporterInfo';
import { notifyOnSettingChanged } from '../../lib/server/lib/notifyListener';

export class SlackUsersImporter extends Importer {
private csvParser: (csv: string) => string[];

constructor(info: ImporterInfo, importRecord: IImport, converterOptions: IConverterOptions = {}) {
constructor(info: ImporterInfo, importRecord: IImport, converterOptions: ConverterOptions = {}) {
super(info, importRecord, converterOptions);

this.csvParser = parse;
Expand Down
Loading

0 comments on commit cf84c57

Please sign in to comment.