IdealChain / signal-media-exporter

A script to export media files from Signal Desktop.
GNU General Public License v3.0
31 stars 10 forks source link

Crash with senders with undisclosed number #17

Closed jaymanu79 closed 3 months ago

jaymanu79 commented 3 months ago

Hello and thanks for the great work

There is new feature which allows signal users to hide their phone number. They can give a pseudonym instead. That made the media exporter crashing for me. Also for some reason, one single contact of mine gives None value as "sender", but his number appears in "source" field of the msg.

So I added below patch in main.py line 113 :

    if sender is None:
        if 'source' in msg:
            sender=msg['source']
        else:
            sender = 'Unknown sender'

and that fixed both issues for me. It would be neater to get the actual pseudonym from the DB, instead of "unknown sender", but that's sufficient for my use.

regards

IdealChain commented 3 months ago

Hi, thanks for the report!

Did/does this happen before or after my code changes from last week? I did that because I noticed the source field in msg becoming unreliable, surely also due to the Signal changes for pseudonymous sender support.

I don't think I have any such messages, so I can't reproduce that issue at the moment. But I'm guessing that the e164 field is null in that case, and we should fallback to the name or profileName field.

Since the map field in the config.json also serves as a filter for which conversations should be exported, we should put that functionality behind an optional flag, I guess.

jaymanu79 commented 3 months ago

Did/does this happen before or after my code changes from last week? I did that because I noticed the source field in msg becoming unreliable, surely also due to the Signal changes for pseudonymous sender support.

I only discovered your project today, so it's likely after your code change.

Let me know if I can help, if you need me to run any query.

regards