Skip to content
Merged
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
4 changes: 2 additions & 2 deletions packit/.elyxbuilder/stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
builds: 559
builds: 562
compiledBuilds: 21
failedBuilds: 9
uncompiledBuilds: 529
uncompiledBuilds: 532
2 changes: 1 addition & 1 deletion packit/meta.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: PackIt
description: "{plugin_description} [shareui/packit-source](https://github.com/shareui/packit-source)"
id: shareui_packit
version: "0.1.1-dev"
version: "1.0.0-dev"
author: "@packitX"
app_version: ">=12.9.0"
sdk_version: ">=1.4.5.0"
Expand Down
26 changes: 17 additions & 9 deletions packit/src/python/integrations/chat/inline/InlineBtns.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,19 +412,27 @@ def dismiss_loading():
logx(f"inlineBtns: downloaded {len(r.content)} bytes to {file_path}", True)

# send document to the current dialog — and, in a forum, to the topic
# the message lives in. send_document() only takes a peer, so the file
# always landed in the General topic; send_message() carries
# replyToTopMsg the same way the inline message send does.
# the message lives in. send_document() is the high-level helper that
# correctly builds SendMessageParams for file sending.
try:
dialog_id = message_object.getDialogId()
params = {"peer": dialog_id, "path": file_path}
topic_msg_obj = _resolve_topic_message(dialog_id)
send_kwargs = {}
if topic_msg_obj is not None:
params["replyToMsg"] = topic_msg_obj
params["replyToTopMsg"] = topic_msg_obj
from client_utils import send_message
send_message(params)
logx(f"inlineBtns: sent document to dialog_id={dialog_id} topic={topic_msg_obj is not None}", True)
send_kwargs["replyToMsg"] = topic_msg_obj
send_kwargs["replyToTopMsg"] = topic_msg_obj

from client_utils import send_document

# send_document calls SendMessagesHelper which requires main thread
def _send_on_main():
try:
send_document(dialog_id, file_path, **send_kwargs)
logx(f"inlineBtns: sent document to dialog_id={dialog_id} topic={topic_msg_obj is not None}", True)
except Exception as e:
logx(f"inlineBtns: send_document on main error: {e}", False)

_run(_send_on_main)
except Exception as e:
logx(f"inlineBtns: send document error: {e}", False)
_run(dismiss_loading)
Expand Down
Loading