Skip to content

Commit 1e6fc58

Browse files
Merge branch 'develop' into chore/updatePayloadIcon
2 parents 589e51c + 76d263e commit 1e6fc58

File tree

156 files changed

+4155
-211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+4155
-211
lines changed

.changeset/nasty-moons-speak.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket.chat/meteor': patch
3+
---
4+
5+
Adds invitation badge to room members list

.changeset/rotten-pugs-trade.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@rocket.chat/meteor": patch
3+
"@rocket.chat/tools": patch
4+
---
5+
6+
Adds improvements to the push notifications logic; the logic now truncates messages and titles larger than 240, and 65 characters respectively.

.github/actions/setup-node/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ runs:
6969
with:
7070
deno-version: ${{ inputs.deno-version }}
7171

72+
- name: Configure mongodb-memory-server cache
73+
shell: bash
74+
run: |
75+
CACHE_DIR="${GITHUB_WORKSPACE}/node_modules/.cache/mongodb-memory-server"
76+
mkdir -p "$CACHE_DIR"
77+
echo "MONGOMS_DOWNLOAD_DIR=$CACHE_DIR" >> $GITHUB_ENV
78+
echo "MONGOMS_PREFER_GLOBAL_PATH=false" >> $GITHUB_ENV
79+
7280
- name: yarn login
7381
shell: bash
7482
if: inputs.NPM_TOKEN

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ nodeLinker: node-modules
1010

1111
plugins:
1212
- path: .yarn/plugins/@yarnpkg/plugin-engines.cjs
13-
spec: "https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js"
13+
spec: 'https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js'
1414

1515
yarnPath: .yarn/releases/yarn-4.11.0.cjs

apps/meteor/CHANGELOG.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,52 @@
11
# @rocket.chat/meteor
22

3+
## 7.13.2
4+
5+
### Patch Changes
6+
7+
- Bump @rocket.chat/meteor version.
8+
9+
- Bump @rocket.chat/meteor version.
10+
11+
- ([#37876](https://github.com/RocketChat/Rocket.Chat/pull/37876) by [@dionisio-bot](https://github.com/dionisio-bot)) Security Hotfix (https://docs.rocket.chat/docs/security-fixes-and-updates)
12+
13+
- ([#37883](https://github.com/RocketChat/Rocket.Chat/pull/37883) by [@dionisio-bot](https://github.com/dionisio-bot)) Ensures presence stays accurate by refreshing connections on heartbeats and removing stale sessions.
14+
15+
- <details><summary>Updated dependencies [eef2b390a8e4664ad4b974e7ea579982245efce5]:</summary>
16+
17+
- @rocket.chat/core-services@0.11.2
18+
- @rocket.chat/presence@0.2.46
19+
- @rocket.chat/federation-matrix@0.0.8
20+
- @rocket.chat/network-broker@0.2.25
21+
- @rocket.chat/omni-core-ee@0.0.11
22+
- @rocket.chat/omnichannel-services@0.3.43
23+
- @rocket.chat/core-typings@7.13.2
24+
- @rocket.chat/rest-typings@7.13.2
25+
- @rocket.chat/license@1.1.6
26+
- @rocket.chat/media-calls@0.1.2
27+
- @rocket.chat/pdf-worker@0.3.25
28+
- @rocket.chat/api-client@0.2.46
29+
- @rocket.chat/apps@0.5.25
30+
- @rocket.chat/cron@0.1.46
31+
- @rocket.chat/freeswitch@1.2.33
32+
- @rocket.chat/fuselage-ui-kit@25.0.2
33+
- @rocket.chat/gazzodown@25.0.2
34+
- @rocket.chat/http-router@7.9.13
35+
- @rocket.chat/message-types@0.0.1
36+
- @rocket.chat/model-typings@1.9.2
37+
- @rocket.chat/ui-avatar@21.0.2
38+
- @rocket.chat/ui-client@25.0.2
39+
- @rocket.chat/ui-contexts@25.0.2
40+
- @rocket.chat/web-ui-registration@25.0.2
41+
- @rocket.chat/models@1.8.2
42+
- @rocket.chat/server-cloud-communication@0.0.2
43+
- @rocket.chat/ui-theming@0.4.4
44+
- @rocket.chat/ui-video-conf@25.0.2
45+
- @rocket.chat/ui-voip@15.0.2
46+
- @rocket.chat/instance-status@0.1.46
47+
- @rocket.chat/omni-core@0.0.11
48+
</details>
49+
350
## 7.13.1
451

552
### Patch Changes

apps/meteor/app/api/server/v1/call-history.ts

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import {
88
validateUnauthorizedErrorResponse,
99
validateForbiddenErrorResponse,
1010
} from '@rocket.chat/rest-typings';
11+
import { escapeRegExp } from '@rocket.chat/string-helpers';
1112

1213
import { ensureArray } from '../../../../lib/utils/arrayUtils';
1314
import type { ExtractRoutesFromAPI } from '../ApiClass';
1415
import { API } from '../api';
1516
import { getPaginationItems } from '../helpers/getPaginationItems';
1617

1718
type CallHistoryList = PaginatedRequest<{
19+
filter?: string;
1820
direction?: CallHistoryItem['direction'];
1921
state?: CallHistoryItemState[] | CallHistoryItemState;
2022
}>;
@@ -31,6 +33,9 @@ const CallHistoryListSchema = {
3133
sort: {
3234
type: 'string',
3335
},
36+
filter: {
37+
type: 'string',
38+
},
3439
direction: {
3540
type: 'string',
3641
enum: ['inbound', 'outbound'],
@@ -106,14 +111,31 @@ const callHistoryListEndpoints = API.v1.get(
106111
const { offset, count } = await getPaginationItems(this.queryParams as Record<string, string | number | null | undefined>);
107112
const { sort } = await this.parseJsonQuery();
108113

109-
const { direction, state } = this.queryParams;
114+
const { direction, state, filter } = this.queryParams;
110115

111-
const stateFilter = state && ensureArray(state);
116+
const filterText = typeof filter === 'string' && filter.trim();
112117

118+
const stateFilter = state && ensureArray(state);
113119
const query = {
114120
uid: this.userId,
115121
...(direction && { direction }),
116122
...(stateFilter?.length && { state: { $in: stateFilter } }),
123+
...(filterText && {
124+
$or: [
125+
{
126+
external: false,
127+
contactName: { $regex: escapeRegExp(filterText), $options: 'i' },
128+
},
129+
{
130+
external: false,
131+
contactUsername: { $regex: escapeRegExp(filterText), $options: 'i' },
132+
},
133+
{
134+
external: true,
135+
contactExtension: { $regex: escapeRegExp(filterText), $options: 'i' },
136+
},
137+
],
138+
}),
117139
};
118140

119141
const { cursor, totalCount } = CallHistory.findPaginated(query, {
@@ -134,7 +156,7 @@ const callHistoryListEndpoints = API.v1.get(
134156

135157
type CallHistoryListEndpoints = ExtractRoutesFromAPI<typeof callHistoryListEndpoints>;
136158

137-
type CallHistoryInfo = { historyId: string; callId: never } | { callId: string; historyId: never };
159+
type CallHistoryInfo = { historyId: string } | { callId: string };
138160

139161
const CallHistoryInfoSchema = {
140162
oneOf: [
@@ -202,13 +224,15 @@ const callHistoryInfoEndpoints = API.v1.get(
202224
authRequired: true,
203225
},
204226
async function action() {
205-
if (!this.queryParams.historyId && !this.queryParams.callId) {
227+
const { historyId, callId } = this.queryParams as Record<string, never> & typeof this.queryParams;
228+
229+
if (!historyId && !callId) {
206230
return API.v1.failure();
207231
}
208232

209-
const item = await (this.queryParams.historyId
210-
? CallHistory.findOneByIdAndUid(this.queryParams.historyId, this.userId)
211-
: CallHistory.findOneByCallIdAndUid(this.queryParams.callId, this.userId));
233+
const item = await (historyId
234+
? CallHistory.findOneByIdAndUid(historyId, this.userId)
235+
: CallHistory.findOneByCallIdAndUid(callId, this.userId));
212236

213237
if (!item) {
214238
return API.v1.notFound();

apps/meteor/app/api/server/v1/im.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,26 @@ API.v1.addRoute(
416416

417417
const [members, total] = await Promise.all([cursor.toArray(), totalCount]);
418418

419+
// find subscriptions of those users
420+
const subs = await Subscriptions.findByRoomIdAndUserIds(
421+
room._id,
422+
members.map((member) => member._id),
423+
{ projection: { u: 1, status: 1, ts: 1, roles: 1 } },
424+
).toArray();
425+
426+
const membersWithSubscriptionInfo = members.map((member) => {
427+
const sub = subs.find((sub) => sub.u._id === member._id);
428+
429+
const { u: _u, ...subscription } = sub || {};
430+
431+
return {
432+
...member,
433+
subscription,
434+
};
435+
});
436+
419437
return API.v1.success({
420-
members,
438+
members: membersWithSubscriptionInfo,
421439
count: members.length,
422440
offset,
423441
total,

apps/meteor/app/push/server/push.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { IAppsTokens, RequiredField, Optional, IPushNotificationConfig } from '@rocket.chat/core-typings';
22
import { AppsTokens } from '@rocket.chat/models';
33
import { serverFetch as fetch } from '@rocket.chat/server-fetch';
4-
import { pick } from '@rocket.chat/tools';
4+
import { pick, truncateString } from '@rocket.chat/tools';
55
import Ajv from 'ajv';
66
import { JWT } from 'google-auth-library';
77
import { Match, check } from 'meteor/check';
@@ -15,6 +15,9 @@ import { settings } from '../../settings/server';
1515

1616
export const _matchToken = Match.OneOf({ apn: String }, { gcm: String });
1717

18+
const PUSH_TITLE_LIMIT = 65;
19+
const PUSH_MESSAGE_BODY_LIMIT = 240;
20+
1821
const ajv = new Ajv({
1922
coerceTypes: true,
2023
});
@@ -459,8 +462,10 @@ class PushClass {
459462
createdBy: '<SERVER>',
460463
sent: false,
461464
sending: 0,
465+
title: truncateString(options.title, PUSH_TITLE_LIMIT),
466+
text: truncateString(options.text, PUSH_MESSAGE_BODY_LIMIT),
462467

463-
...pick(options, 'from', 'title', 'text', 'userId', 'payload', 'badge', 'sound', 'notId', 'priority'),
468+
...pick(options, 'from', 'userId', 'payload', 'badge', 'sound', 'notId', 'priority'),
464469

465470
...(this.hasApnOptions(options)
466471
? {

apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsMenu.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@ type NavBarControlsMenuProps = Omit<HTMLAttributes<HTMLElement>, 'is'> & {
1010
omnichannelItems: GenericMenuItemProps[];
1111
isPressed: boolean;
1212
callItem?: GenericMenuItemProps;
13+
callHistoryItem?: GenericMenuItemProps;
1314
};
1415

15-
const NavBarControlsMenu = ({ omnichannelItems, isPressed, callItem, ...props }: NavBarControlsMenuProps) => {
16+
const NavBarControlsMenu = ({ omnichannelItems, isPressed, callItem, callHistoryItem, ...props }: NavBarControlsMenuProps) => {
1617
const { t } = useTranslation();
1718
const showOmnichannel = useOmnichannelEnabled();
1819

1920
const sections = [
2021
{
2122
title: t('Voice_Call'),
22-
items: callItem ? [callItem] : [],
23+
items: callItem || callHistoryItem ? ([callItem, callHistoryItem].filter(Boolean) as GenericMenuItemProps[]) : [],
2324
},
2425
{
2526
title: t('Omnichannel'),

apps/meteor/client/NavBarV2/NavBarControls/NavBarControlsWithCall.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type NavBarControlsMenuProps = Omit<HTMLAttributes<HTMLElement>, 'is'> & {
99
omnichannelItems: GenericMenuItemProps[];
1010
isPressed: boolean;
1111
callItem?: GenericMenuItemProps;
12+
callHistoryItem?: GenericMenuItemProps;
1213
};
1314

1415
const NavBarControlsWithCall = ({ omnichannelItems, isPressed, ...props }: NavBarControlsMenuProps) => {

0 commit comments

Comments
 (0)