Reproduction:
- Enable Telegram operator/client mode.
- Reply to an LHC chat from Telegram with a document named before_update.rsc.
- In LHC DB lh_chat_file.upload_name becomes file_1149.rsc instead of before_update.rsc.
- Any outgoing webhook/REST integration then forwards file_1149.rsc.
Cause:
GenericmessageCommand::processObject() uses Request::getFile()->getResult()->getFilePath()
to derive upload_name. Telegram file_path is not the original filename. For documents/audio/video,
the original filename is available on the message entity itself: document.file_name, audio.file_name,
video.file_name.
Expected:
Use message document/audio/video file_name when present, fallback to getFile().file_path basename.
Additional note:
Files sent by Telegram operators are currently stored with lh_chat_file.user_id = 0, while the message
itself is stored as operator message. It would be more consistent to store the file with operator user_id.
Reproduction:
Cause:
GenericmessageCommand::processObject() uses Request::getFile()->getResult()->getFilePath()
to derive upload_name. Telegram file_path is not the original filename. For documents/audio/video,
the original filename is available on the message entity itself: document.file_name, audio.file_name,
video.file_name.
Expected:
Use message document/audio/video file_name when present, fallback to getFile().file_path basename.
Additional note:
Files sent by Telegram operators are currently stored with lh_chat_file.user_id = 0, while the message
itself is stored as operator message. It would be more consistent to store the file with operator user_id.