Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Multiple file sharing in one message #32703

Draft
wants to merge 144 commits into
base: develop
Choose a base branch
from

Conversation

abhipatel0211
Copy link
Contributor

Proposed changes (including videos or screenshots)

Changes

  1. Multiple file sharing in one message.
  2. Multiple file sharing in one message in E2E encrypted rooms.
  3. Functionality of adding and removing files in FileUploadModal.
  4. Updated API endpoints rooms.media/:rid and rooms.mediaConfirm/:rid/:fileId to handle multiple files.

Steps to test or reproduce

  1. Go to a room.
  2. Try sharing multiple files.
  3. Confirm file selected.
  4. Use the FileUploadModal to add and remove files.

Further comments

This implementation is an initial version of the multiple file sharing feature. While it is functional, some minor bugs remain, particularly with image file sharing, which will be addressed in future updates.

apps/meteor/app/lib/server/methods/sendMessage.ts Outdated Show resolved Hide resolved
apps/meteor/app/lib/server/functions/sendMessage.ts Outdated Show resolved Hide resolved
apps/meteor/app/lib/server/functions/sendMessage.ts Outdated Show resolved Hide resolved
apps/meteor/app/lib/server/functions/sendMessage.ts Outdated Show resolved Hide resolved
…e files by calling parseFileIntoMessageAttachments multiple times
Copy link
Contributor

dionisio-bot bot commented Aug 21, 2024

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@@ -30,7 +30,7 @@ const wipeFailedOnes = (): void => {
};

const send = async (
file: File,
file: File[] | File,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you should extract the upload logic to another function

apps/meteor/app/lib/server/functions/sendMessage.ts Outdated Show resolved Hide resolved
apps/meteor/app/lib/server/functions/sendMessage.ts Outdated Show resolved Hide resolved
@@ -212,14 +213,71 @@ export function prepareMessageObject(
}
}

const parseFilesIntoMessageAttachments = async (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, this is right, I'd only move this function to the same place of parseFileIntoMessageAttachments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you sir for your feedback!

Currently I've renamed the function to parseMultipleFilesIntoAttachments and moved its location to sendFileMessage . or else we could update parseFileIntoMessageAttachments to handle multiple files also. Which approach do you think is better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parseMultipleFilesIntoAttachments sounds good

apps/meteor/app/lib/server/functions/sendMessage.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants