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

only dataMessages have attachments? #88

Open
jamesoncollins opened this issue Jan 11, 2025 · 2 comments
Open

only dataMessages have attachments? #88

jamesoncollins opened this issue Jan 11, 2025 · 2 comments

Comments

@jamesoncollins
Copy link

In parse() all data messages are checked for attachments, but not sync messages.

If I look in the raw envelope of a sync message, one which contains an attachment, I will see the attachments but only their file names and no base64 string.

Is there some issue with sync messages and attachments? I have no idea what the difference is between the two message tyoes.

@jamesoncollins
Copy link
Author

Ok, I think I see, it looks like its just a matter of adding _parse_attachments to sync messages in parse, like below. Is there a reason this shouldnt be done?

        if "syncMessage" in raw_message["envelope"]:
            type = MessageType.SYNC_MESSAGE
            text = cls._parse_sync_message(raw_message["envelope"]["syncMessage"])
            group = cls._parse_group_information(
                raw_message["envelope"]["syncMessage"]["sentMessage"]
            )
            reaction = cls._parse_reaction(
                raw_message["envelope"]["syncMessage"]["sentMessage"]
            )
            mentions = cls._parse_mentions(
                raw_message["envelope"]["syncMessage"]["sentMessage"]
            )
            base64_attachments = await cls._parse_attachments(
                signal, raw_message["envelope"]["syncMessage"]["sentMessage"]
            )
            attachments_local_filenames = cls._parse_attachments_local_filenames(
                raw_message["envelope"]["syncMessage"]["sentMessage"]
            )

@Era-Dorta
Copy link
Collaborator

Sorry about that, I didn't take into account the sync messages when implementing the feature. I won't be able to fix this in the next few weeks so feel free to make a PR if you cannot wait.

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

No branches or pull requests

2 participants