Skip to content

Commit

Permalink
regression: FED-116 allow to invite rc users to fed channels (#30658)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmauromb authored Dec 7, 2023
1 parent d7905a3 commit a271587
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 5 deletions.
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
1 change: 1 addition & 0 deletions apps/meteor/app/lib/server/functions/createRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ async function createUsersSubscriptions({
const extra: Partial<ISubscriptionExtraData> = options?.subscriptionExtra || {};
extra.open = true;
extra.ls = now;
extra.roles = ['owner'];

if (room.prid) {
extra.prid = room.prid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const AddMatrixUsersModal = ({ onClose, matrixIdVerifiedStatus, onSave, complete
const usersToInvite = completeUserList.filter(
(user) => !(matrixIdVerifiedStatus.has(user) && matrixIdVerifiedStatus.get(user) === 'UNVERIFIED'),
);
const rocketChatUsers = usersToInvite.filter((user) => !matrixIdVerifiedStatus.has(user));

const { handleSubmit } = useForm<FormValues>({
defaultValues: {
Expand All @@ -53,7 +54,7 @@ const AddMatrixUsersModal = ({ onClose, matrixIdVerifiedStatus, onSave, complete
<Modal>
<Modal.Header>
<Modal.HeaderText>
<Modal.Title>Sending Invitations</Modal.Title>
<Modal.Title>{t('Continue_Adding')}</Modal.Title>
</Modal.HeaderText>
<Modal.Close title={t('Close')} onClick={onClose} />
</Modal.Header>
Expand All @@ -65,6 +66,9 @@ const AddMatrixUsersModal = ({ onClose, matrixIdVerifiedStatus, onSave, complete
{_matrixId}: <Icon name={verificationStatusAsIcon(_verificationStatus) as ComponentProps<typeof Icon>['name']} size='x20' />
</li>
))}
{rocketChatUsers.map((_user) => (
<li key={`rocket-chat-${_user}`}>{_user}</li>
))}
</Box>
</Box>
</Modal.Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ export const useAddMatrixUsers = () => {
try {
let matrixIdVerificationMap = new Map();
const matrixIds = users.filter((user) => user.startsWith('@'));
const matrixIdsVerificationResponse = await dispatchVerifyEndpoint({ matrixIds });
const { results: matrixIdsVerificationResults } = matrixIdsVerificationResponse;
matrixIdVerificationMap = new Map(Object.entries(matrixIdsVerificationResults));
if (matrixIds.length > 0) {
const matrixIdsVerificationResponse = await dispatchVerifyEndpoint({ matrixIds });
const { results: matrixIdsVerificationResults } = matrixIdsVerificationResponse;
matrixIdVerificationMap = new Map(Object.entries(matrixIdsVerificationResults));
}

setModal(
<AddMatrixUsersModal
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/ee/server/startup/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void (async () => {
})();

await License.onLicense('federation', async () => {
const federationServiceEE = new FederationServiceEE();
const federationServiceEE = await FederationServiceEE.createFederationService();
if (federationService) {
api.destroyService(federationService);
}
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,7 @@
"Contact_Info": "Contact Information",
"Content": "Content",
"Continue": "Continue",
"Continue_Adding": "Continue Adding?",
"Continuous_sound_notifications_for_new_livechat_room": "Continuous sound notifications for new omnichannel room",
"convert-team": "Convert Team",
"convert-team_description": "Permission to convert team to channel",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const FederationVerifyMatrixIdPropsSchema = {
type: 'array',
items: { type: 'string' },
uniqueItems: true,
minItems: 1,
maxItems: 15,
},
},
additionalProperties: false,
Expand Down

0 comments on commit a271587

Please sign in to comment.