Skip to content

Commit

Permalink
Merge branch 'develop' into feat/mentionBot
Browse files Browse the repository at this point in the history
  • Loading branch information
scuciatto authored Dec 8, 2023
2 parents 9b6f0b2 + 0e8e2e5 commit 3d19d0f
Show file tree
Hide file tree
Showing 480 changed files with 19,606 additions and 4,079 deletions.
56 changes: 56 additions & 0 deletions .changeset/beige-coats-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
'@rocket.chat/ui-kit': minor
'@rocket.chat/server-cloud-communication': patch
'@rocket.chat/omnichannel-services': patch
'rocketchat-services': patch
'@rocket.chat/omnichannel-transcript': patch
'@rocket.chat/authorization-service': patch
'@rocket.chat/web-ui-registration': patch
'@rocket.chat/stream-hub-service': patch
'@rocket.chat/password-policies': patch
'@rocket.chat/uikit-playground': patch
'@rocket.chat/presence-service': patch
'@rocket.chat/fuselage-ui-kit': patch
'@rocket.chat/instance-status': patch
'@rocket.chat/account-service': patch
'@rocket.chat/mock-providers': patch
'@rocket.chat/release-action': patch
'@rocket.chat/api-client': patch
'@rocket.chat/ddp-client': patch
'@rocket.chat/pdf-worker': patch
'@rocket.chat/ui-theming': patch
'@rocket.chat/account-utils': patch
'@rocket.chat/core-services': patch
'@rocket.chat/eslint-config': patch
'@rocket.chat/model-typings': patch
'@rocket.chat/ui-video-conf': patch
'@rocket.chat/cas-validate': patch
'@rocket.chat/core-typings': patch
'@rocket.chat/rest-typings': patch
'@rocket.chat/server-fetch': patch
'@rocket.chat/ddp-streamer': patch
'@rocket.chat/queue-worker': patch
'@rocket.chat/presence': patch
'@rocket.chat/poplib': patch
'@rocket.chat/ui-composer': patch
'@rocket.chat/ui-contexts': patch
'@rocket.chat/license': patch
'@rocket.chat/log-format': patch
'@rocket.chat/gazzodown': patch
'@rocket.chat/ui-client': patch
'@rocket.chat/livechat': patch
'@rocket.chat/favicon': patch
'@rocket.chat/agenda': patch
'@rocket.chat/base64': patch
'@rocket.chat/logger': patch
'@rocket.chat/models': patch
'@rocket.chat/random': patch
'@rocket.chat/sha256': patch
'@rocket.chat/tools': patch
'@rocket.chat/cron': patch
'@rocket.chat/i18n': patch
'@rocket.chat/jwt': patch
'@rocket.chat/meteor': patch
---

feat(uikit): Move `@rocket.chat/ui-kit` package to the main monorepo
6 changes: 6 additions & 0 deletions .changeset/fifty-maps-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rocket.chat/meteor": minor
"@rocket.chat/rest-typings": minor
---

Added `push.info` endpoint to enable users to retrieve info about the workspace's push gateway
5 changes: 5 additions & 0 deletions .changeset/fresh-radios-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fixed issue with the new `custom-roles` license module not being checked throughout the application
7 changes: 7 additions & 0 deletions .changeset/kind-beers-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@rocket.chat/meteor": minor
"@rocket.chat/ui-client": minor
"@rocket.chat/web-ui-registration": minor
---

feat: Skip to main content shortcut and useDocumentTitle
6 changes: 6 additions & 0 deletions .changeset/nasty-islands-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rocket.chat/rest-typings': minor
'@rocket.chat/meteor': minor
---

fix Federation Regression, builds service correctly
320 changes: 320 additions & 0 deletions .yarn/patches/typia-npm-5.3.3-21d3e18463.patch

Large diffs are not rendered by default.

783 changes: 0 additions & 783 deletions .yarn/releases/yarn-3.2.2.cjs

This file was deleted.

873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.5.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"

yarnPath: .yarn/releases/yarn-3.2.2.cjs
yarnPath: .yarn/releases/yarn-3.5.0.cjs
28 changes: 23 additions & 5 deletions apps/meteor/app/api/server/v1/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ import {
isDownloadPendingFilesParamsPOST,
isDownloadPendingAvatarsParamsPOST,
isGetCurrentImportOperationParamsGET,
isImportersListParamsGET,
isImportAddUsersParamsPOST,
} from '@rocket.chat/rest-typings';
import { Meteor } from 'meteor/meteor';

import { PendingAvatarImporter } from '../../../importer-pending-avatars/server/PendingAvatarImporter';
import { PendingFileImporter } from '../../../importer-pending-files/server/PendingFileImporter';
import { Importers } from '../../../importer/server';
import {
executeUploadImportFile,
Expand Down Expand Up @@ -136,9 +139,8 @@ API.v1.addRoute(
}

const operation = await Import.newOperation(this.userId, importer.name, importer.key);

importer.instance = new importer.importer(importer, operation); // eslint-disable-line new-cap
const count = await importer.instance.prepareFileCount();
const instance = new PendingFileImporter(importer, operation);
const count = await instance.prepareFileCount();

return API.v1.success({
count,
Expand All @@ -162,8 +164,8 @@ API.v1.addRoute(
}

const operation = await Import.newOperation(this.userId, importer.name, importer.key);
importer.instance = new importer.importer(importer, operation); // eslint-disable-line new-cap
const count = await importer.instance.prepareFileCount();
const instance = new PendingAvatarImporter(importer, operation);
const count = await instance.prepareFileCount();

return API.v1.success({
count,
Expand All @@ -189,6 +191,22 @@ API.v1.addRoute(
},
);

API.v1.addRoute(
'importers.list',
{
authRequired: true,
validateParams: isImportersListParamsGET,
permissionsRequired: ['run-import'],
},
{
async get() {
const importers = Importers.getAllVisible().map(({ key, name }) => ({ key, name }));

return API.v1.success(importers);
},
},
);

API.v1.addRoute(
'import.clear',
{
Expand Down
18 changes: 17 additions & 1 deletion apps/meteor/app/api/server/v1/push.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Messages, AppsTokens, Users, Rooms } from '@rocket.chat/models';
import { Messages, AppsTokens, Users, Rooms, Settings } from '@rocket.chat/models';
import { Random } from '@rocket.chat/random';
import { Match, check } from 'meteor/check';
import { Meteor } from 'meteor/meteor';

import { canAccessRoomAsync } from '../../../authorization/server/functions/canAccessRoom';
import PushNotification from '../../../push-notifications/server/lib/PushNotification';
import { settings } from '../../../settings/server';
import { API } from '../api';

API.v1.addRoute(
Expand Down Expand Up @@ -110,3 +111,18 @@ API.v1.addRoute(
},
},
);

API.v1.addRoute(
'push.info',
{ authRequired: true },
{
async get() {
const defaultGateway = (await Settings.findOneById('Push_gateway', { projection: { packageValue: 1 } }))?.packageValue;
const defaultPushGateway = settings.get('Push_gateway') === defaultGateway;
return API.v1.success({
pushGatewayEnabled: settings.get('Push_enable'),
defaultPushGateway,
});
},
},
);
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/uiInteraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { IUIKitInteraction } from '@rocket.chat/apps-engine/definition/uiki
import type { IUser } from '@rocket.chat/apps-engine/definition/users';
import { UiInteractionBridge as AppsEngineUiInteractionBridge } from '@rocket.chat/apps-engine/server/bridges/UiInteractionBridge';
import { api } from '@rocket.chat/core-services';
import type { UiKit } from '@rocket.chat/core-typings';
import type * as UiKit from '@rocket.chat/ui-kit';

import type { AppServerOrchestrator } from '../../../../ee/server/apps/orchestrator';

Expand Down
11 changes: 11 additions & 0 deletions apps/meteor/app/autotranslate/server/autotranslate.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { api } from '@rocket.chat/core-services';
import type {
IMessage,
IRoom,
Expand All @@ -15,6 +16,7 @@ import _ from 'underscore';

import { callbacks } from '../../../lib/callbacks';
import { isTruthy } from '../../../lib/isTruthy';
import { broadcastMessageSentEvent } from '../../../server/modules/watchers/lib/messages';
import { Markdown } from '../../markdown/server';
import { settings } from '../../settings/server';

Expand Down Expand Up @@ -305,6 +307,7 @@ export abstract class AutoTranslate {
const translations = await this._translateMessage(targetMessage, targetLanguages);
if (!_.isEmpty(translations)) {
await Messages.addTranslations(message._id, translations, TranslationProviderRegistry[Provider] || '');
this.notifyTranslatedMessage(message._id);
}
});
}
Expand All @@ -320,6 +323,7 @@ export abstract class AutoTranslate {

if (!_.isEmpty(translations)) {
await Messages.addAttachmentTranslations(message._id, String(index), translations);
this.notifyTranslatedMessage(message._id);
}
}
}
Expand All @@ -328,6 +332,13 @@ export abstract class AutoTranslate {
return Messages.findOneById(message._id);
}

private notifyTranslatedMessage(messageId: string): void {
void broadcastMessageSentEvent({
id: messageId,
broadcastCallback: (message) => api.broadcast('message.sent', message),
});
}

/**
* Returns metadata information about the service provider which is used by
* the generic implementation
Expand Down
42 changes: 42 additions & 0 deletions apps/meteor/app/federation/server/endpoints/dispatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { eventTypes } from '@rocket.chat/core-typings';
import { FederationServers, FederationRoomEvents, Rooms, Messages, Subscriptions, Users, ReadReceipts } from '@rocket.chat/models';
import EJSON from 'ejson';

import { broadcastMessageSentEvent } from '../../../../server/modules/watchers/lib/messages';
import { API } from '../../../api/server';
import { FileUpload } from '../../../file-upload/server';
import { deleteRoom } from '../../../lib/server/functions/deleteRoom';
Expand Down Expand Up @@ -214,11 +215,13 @@ const eventHandlers = {

// Check if message exists
const persistedMessage = await Messages.findOne({ _id: message._id });
let messageForNotification;

if (persistedMessage) {
// Update the federation
if (!persistedMessage.federation) {
await Messages.updateOne({ _id: persistedMessage._id }, { $set: { federation: message.federation } });
messageForNotification = { ...persistedMessage, federation: message.federation };
}
} else {
// Load the room
Expand Down Expand Up @@ -275,10 +278,18 @@ const eventHandlers = {
// Notify users
await notifyUsersOnMessage(denormalizedMessage, room);
sendAllNotifications(denormalizedMessage, room);
messageForNotification = denormalizedMessage;
} catch (err) {
serverLogger.debug(`Error on creating message: ${message._id}`);
}
}
if (messageForNotification) {
void broadcastMessageSentEvent({
id: messageForNotification._id,
data: messageForNotification,
broadcastCallback: (message) => api.broadcast('message.sent', message),
});
}
}

return eventResult;
Expand All @@ -305,6 +316,15 @@ const eventHandlers = {
} else {
// Update the message
await Messages.updateOne({ _id: persistedMessage._id }, { $set: { msg: message.msg, federation: message.federation } });
void broadcastMessageSentEvent({
id: persistedMessage._id,
data: {
...persistedMessage,
msg: message.msg,
federation: message.federation,
},
broadcastCallback: (message) => api.broadcast('message.sent', message),
});
}
}

Expand Down Expand Up @@ -367,6 +387,17 @@ const eventHandlers = {

// Update the property
await Messages.updateOne({ _id: messageId }, { $set: { [`reactions.${reaction}`]: reactionObj } });
void broadcastMessageSentEvent({
id: persistedMessage._id,
data: {
...persistedMessage,
reactions: {
...persistedMessage.reactions,
[reaction]: reactionObj,
},
},
broadcastCallback: (message) => api.broadcast('message.sent', message),
});
}

return eventResult;
Expand Down Expand Up @@ -415,6 +446,17 @@ const eventHandlers = {
// Otherwise, update the property
await Messages.updateOne({ _id: messageId }, { $set: { [`reactions.${reaction}`]: reactionObj } });
}
void broadcastMessageSentEvent({
id: persistedMessage._id,
data: {
...persistedMessage,
reactions: {
...persistedMessage.reactions,
[reaction]: reactionObj,
},
},
broadcastCallback: (message) => api.broadcast('message.sent', message),
});
}

return eventResult;
Expand Down
4 changes: 0 additions & 4 deletions apps/meteor/app/importer-csv/client/adder.js

This file was deleted.

1 change: 0 additions & 1 deletion apps/meteor/app/importer-csv/client/index.ts

This file was deleted.

12 changes: 0 additions & 12 deletions apps/meteor/app/importer-csv/lib/info.js

This file was deleted.

Loading

0 comments on commit 3d19d0f

Please sign in to comment.