lhctelegram loses original filenames for operator attachments sent from Telegram.

Open Beginner friendly
#71 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
php
Domain
backend

Research direction

Start at GenericmessageCommand::processObject() and trace how Telegram documents, audio, and video messages derive lh_chat_file.upload_name. Reproduce the Telegram operator attachment case and verify that the original message filename is retained, with the file_path basename used only as fallback; also check that operator-uploaded files receive the operator user_id.

Written by the indexing model from the issue text.

Description

enhancement

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.

Dominant language
PHP
Stars
59
Forks
36
Avg merge
6h 40m
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LiveHelperChat/telegram

All issues in LiveHelperChat/telegram

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.