snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import type { IUser } from '@rocket.chat/core-typings';
|
||||
import { useStream } from '@rocket.chat/ui-contexts';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { RoomHistoryManager } from '../../../lib/RoomHistoryManager';
|
||||
|
||||
export const useClearRemovedRoomsHistory = (userId: IUser['_id'] | undefined) => {
|
||||
const subscribeToNotifyUser = useStream('notify-user');
|
||||
useEffect(() => {
|
||||
if (!userId) {
|
||||
return;
|
||||
}
|
||||
|
||||
return subscribeToNotifyUser(`${userId}/subscriptions-changed`, (event, data) => {
|
||||
if (data.t !== 'l' && event === 'removed' && data.rid) {
|
||||
RoomHistoryManager.clear(data.rid);
|
||||
}
|
||||
});
|
||||
}, [userId, subscribeToNotifyUser]);
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
import { useStream, useUserId } from '@rocket.chat/ui-contexts';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { Messages } from '../../../stores';
|
||||
|
||||
export const useDeleteUser = () => {
|
||||
const notify = useStream('notify-logged');
|
||||
|
||||
const uid = useUserId();
|
||||
|
||||
const updateMessages = Messages.use((state) => state.update);
|
||||
const removeMessages = Messages.use((state) => state.remove);
|
||||
|
||||
useEffect(() => {
|
||||
if (!uid) {
|
||||
return;
|
||||
}
|
||||
return notify('Users:Deleted', ({ userId, messageErasureType, replaceByUser }) => {
|
||||
if (messageErasureType === 'Unlink' && replaceByUser) {
|
||||
return updateMessages(
|
||||
(record) => record.u._id === userId,
|
||||
(record) => ({
|
||||
...record,
|
||||
alias: replaceByUser.alias,
|
||||
u: { ...record.u, _id: replaceByUser._id, username: replaceByUser.username ?? record.u.username, name: undefined },
|
||||
}),
|
||||
);
|
||||
}
|
||||
removeMessages((record) => record.u._id === userId);
|
||||
});
|
||||
}, [notify, removeMessages, uid, updateMessages]);
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
import type { IUser } from '@rocket.chat/core-typings';
|
||||
import { useSetting, useToastMessageDispatch } from '@rocket.chat/ui-contexts';
|
||||
import { useRef, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export function useEmailVerificationWarning(user: IUser | undefined) {
|
||||
const emailVerificationEnabled = useSetting('Accounts_EmailVerification', false);
|
||||
const dispatchToastMessage = useToastMessageDispatch();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const mainEmail = user?.emails?.[0];
|
||||
const warnedRef = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
const { current: warned } = warnedRef;
|
||||
if (mainEmail && mainEmail.verified !== true && emailVerificationEnabled && !warned) {
|
||||
dispatchToastMessage({
|
||||
type: 'warning',
|
||||
message: t('core.You_have_not_verified_your_email'),
|
||||
});
|
||||
warnedRef.current = true;
|
||||
}
|
||||
}, [mainEmail, emailVerificationEnabled, dispatchToastMessage, t]);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import type { IUser } from '@rocket.chat/core-typings';
|
||||
import { useRouter } from '@rocket.chat/ui-contexts';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
import { LegacyRoomManager } from '../../../lib/LegacyRoomManager';
|
||||
import { roomCoordinator } from '../../../lib/rooms/roomCoordinator';
|
||||
|
||||
export const useReloadAfterLogin = (user: IUser | null) => {
|
||||
const usernameRef = useRef<string>(undefined);
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
const isNewUser = !usernameRef.current && user?.username;
|
||||
const usernameChanged = user?.username && usernameRef.current !== user.username;
|
||||
|
||||
if (isNewUser || usernameChanged) {
|
||||
usernameRef.current = user.username;
|
||||
|
||||
LegacyRoomManager.closeAllRooms();
|
||||
|
||||
const routeName = router.getRouteName();
|
||||
if (!routeName) {
|
||||
return;
|
||||
}
|
||||
|
||||
const roomType = roomCoordinator.getRouteNameIdentifier(routeName);
|
||||
if (roomType) {
|
||||
router.navigate({
|
||||
name: routeName,
|
||||
params: router.getRouteParameters(),
|
||||
search: router.getSearchParameters(),
|
||||
});
|
||||
}
|
||||
}
|
||||
// Purposely not cleaning up usernameRef - it needs to be persistent when logging out/in
|
||||
}, [router, user?.username]);
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
import { useUserId, useStream } from '@rocket.chat/ui-contexts';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { Users } from '../../../stores';
|
||||
|
||||
export const useUpdateAvatar = () => {
|
||||
const notify = useStream('notify-logged');
|
||||
const uid = useUserId();
|
||||
useEffect(() => {
|
||||
if (!uid) {
|
||||
return;
|
||||
}
|
||||
return notify('updateAvatar', (data) => {
|
||||
if ('username' in data) {
|
||||
const { username, etag } = data;
|
||||
username &&
|
||||
Users.state.update(
|
||||
(record) => record.username === username,
|
||||
(record) => ({ ...record, avatarETag: etag }),
|
||||
);
|
||||
}
|
||||
});
|
||||
}, [notify, uid]);
|
||||
};
|
||||
Reference in New Issue
Block a user