Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gateway/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -20560,6 +20560,7 @@ def _interim_assistant_cb(text: str, *, already_streamed: bool = False) -> None:
_status_adapter.send(
_status_chat_id,
display_text,
reply_to=event_message_id,
metadata=_status_thread_metadata,
),
_loop_for_step,
Expand Down
1 change: 1 addition & 0 deletions gateway/stream_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,7 @@ async def _send_commentary(self, text: str) -> bool:
result = await self.adapter.send(
chat_id=self.chat_id,
content=text,
reply_to=self._initial_reply_to_id,
metadata=self.metadata,
)
# Note: do NOT set _already_sent = True here.
Expand Down
21 changes: 13 additions & 8 deletions plugins/platforms/telegram/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8417,18 +8417,22 @@ def _enqueue_photo_event(self, batch_key: str, event: MessageEvent) -> None:

async def _handle_media_message(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
"""Handle incoming media messages, downloading images to local cache."""
if not update.message:
# Use effective_message so channel posts (update.channel_post) are
# handled too — plain update.message is None for channel broadcasts,
# which silently dropped forwarded media in channels.
msg = self._effective_update_message(update)
if not msg:
return
if not self._is_user_authorized_from_message(update.message):
if not self._is_user_authorized_from_message(msg):
logger.info(
"[Telegram] Blocked media from unauthorized user %s in chat %s",
getattr(getattr(update.message, "from_user", None), "id", None),
getattr(getattr(update.message, "chat", None), "id", None),
getattr(getattr(msg, "from_user", None), "id", None),
getattr(getattr(msg, "chat", None), "id", None),
)
return
if not self._should_process_message(update.message):
if self._should_observe_unmentioned_group_message(update.message):
_m = update.message
if not self._should_process_message(msg):
if self._should_observe_unmentioned_group_message(msg):
_m = msg
_observe_type = self._media_message_type(_m)
_event = self._build_message_event(_m, _observe_type, update_id=update.update_id)
if _m.caption:
Expand All @@ -8439,7 +8443,8 @@ async def _handle_media_message(self, update: Update, context: ContextTypes.DEFA
)
return

msg = update.message
# msg already resolved via _effective_update_message above (handles
# channel posts); keep the local reference for the rest of the handler.

msg_type = self._media_message_type(msg)

Expand Down