Skip to content

lhctelegram loses original filenames for operator attachments sent from Telegram. #71

Description

@mysubcult

Reproduction:

  1. Enable Telegram operator/client mode.
  2. Reply to an LHC chat from Telegram with a document named before_update.rsc.
  3. In LHC DB lh_chat_file.upload_name becomes file_1149.rsc instead of before_update.rsc.
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions