telepost-bot 2.85.0__tar.gz → 2.85.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/CHANGELOG.md +7 -0
  2. {telepost_bot-2.85.0/telepost_bot.egg-info → telepost_bot-2.85.1}/PKG-INFO +2 -2
  3. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/README.en.md +1 -1
  4. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/README.md +1 -1
  5. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/database/db_manager.py +11 -1
  6. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/command_handlers.py +1 -1
  7. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/conversation.py +37 -14
  8. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/mode_selection.py +5 -2
  9. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/preview_handlers.py +38 -20
  10. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/publish.py +6 -1
  11. telepost_bot-2.85.1/handlers/submission_controls.py +36 -0
  12. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/upload.py +65 -17
  13. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/main.py +7 -3
  14. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/posts.py +2 -0
  15. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/build_info.py +1 -1
  16. telepost_bot-2.85.1/telepost/storage/sqlite/posts.py +117 -0
  17. {telepost_bot-2.85.0 → telepost_bot-2.85.1/telepost_bot.egg-info}/PKG-INFO +2 -2
  18. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost_bot.egg-info/SOURCES.txt +3 -2
  19. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_conversation_flow.py +10 -7
  20. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_messages.py +5 -6
  21. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_miniapp_api.py +61 -0
  22. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_production_handler_graph.py +128 -14
  23. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_update_inbox.py +18 -2
  24. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_upload.py +11 -12
  25. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/ui/locales/en/LC_MESSAGES/telepost.mo +0 -0
  26. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/ui/locales/en/LC_MESSAGES/telepost.po +41 -20
  27. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/ui/messages.py +21 -12
  28. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/api_server.py +34 -0
  29. telepost_bot-2.85.1/webapp/dist/assets/index-DsmBtje4.js +115 -0
  30. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/webapp/dist/index.html +1 -1
  31. telepost_bot-2.85.0/telepost/storage/sqlite/posts.py +0 -68
  32. telepost_bot-2.85.0/webapp/dist/assets/index-C8XZJyo3.js +0 -115
  33. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/LICENSE +0 -0
  34. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/MANIFEST.in +0 -0
  35. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/config/__init__.py +0 -0
  36. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/config/fly-telepost-policy.example.json +0 -0
  37. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/config/review_policy.md +0 -0
  38. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/config/settings.py +0 -0
  39. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/config.ini.example +0 -0
  40. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/database/__init__.py +0 -0
  41. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/__init__.py +0 -0
  42. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/api_commands.py +0 -0
  43. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/automation.py +0 -0
  44. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/botconfig.py +0 -0
  45. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/callback_handlers.py +0 -0
  46. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/channel_listener.py +0 -0
  47. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/error_handler.py +0 -0
  48. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/index_handlers.py +0 -0
  49. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/moderation.py +0 -0
  50. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/reaction_stats.py +0 -0
  51. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/recovery.py +0 -0
  52. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/review.py +0 -0
  53. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/schedule_status.py +0 -0
  54. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/search_handlers.py +0 -0
  55. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/handlers/stats_handlers.py +0 -0
  56. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/mcp_server/__init__.py +0 -0
  57. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/mcp_server/review_client.py +0 -0
  58. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/mcp_server/server.py +0 -0
  59. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/models/__init__.py +0 -0
  60. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/models/state.py +0 -0
  61. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/__init__.py +0 -0
  62. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/SOURCES.sha256 +0 -0
  63. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/__init__.py +0 -0
  64. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/error-mapping.json +0 -0
  65. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/ackresult.candidate_search.json +0 -0
  66. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/capabilities.pixivflow.json +0 -0
  67. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/event.job.expired.json +0 -0
  68. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/event.job.succeeded.json +0 -0
  69. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/eventpage.candidate_search.json +0 -0
  70. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/job.cancelled.candidate_search.json +0 -0
  71. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/job.failed.no_candidate.json +0 -0
  72. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/job.queued.json +0 -0
  73. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/job.running.json +0 -0
  74. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/job.succeeded.candidate_search.json +0 -0
  75. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/jobpage.candidate_search.json +0 -0
  76. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/task.candidate_search.json +0 -0
  77. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/fixtures/task.candidate_search.target_only.json +0 -0
  78. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/protocol/v1/protocol.schema.json +0 -0
  79. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/pyproject.toml +0 -0
  80. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/run.py +0 -0
  81. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/services/__init__.py +0 -0
  82. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/services/review_service.py +0 -0
  83. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/setup.cfg +0 -0
  84. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/__init__.py +0 -0
  85. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/api/__init__.py +0 -0
  86. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/__init__.py +0 -0
  87. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/admin_ops.py +0 -0
  88. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/automation.py +0 -0
  89. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/delivery_planner.py +0 -0
  90. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/editorial.py +0 -0
  91. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/hot.py +0 -0
  92. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/novel_fallback_card.py +0 -0
  93. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/novel_preview.py +0 -0
  94. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/pixivflow_jobs.py +0 -0
  95. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/post_media.py +0 -0
  96. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/preview_recovery.py +0 -0
  97. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/publication.py +0 -0
  98. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/reaction_backfill.py +0 -0
  99. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/recovery.py +0 -0
  100. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/refetch.py +0 -0
  101. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/rerender.py +0 -0
  102. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/resubmit.py +0 -0
  103. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/review_queue.py +0 -0
  104. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/submitter_notify.py +0 -0
  105. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/application/telepress_provider.py +0 -0
  106. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/__init__.py +0 -0
  107. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/automation.py +0 -0
  108. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/delivery.py +0 -0
  109. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/editorial.py +0 -0
  110. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/errors.py +0 -0
  111. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/hot.py +0 -0
  112. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/media.py +0 -0
  113. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/navigation.py +0 -0
  114. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/novel_preview.py +0 -0
  115. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/packing.py +0 -0
  116. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/presentation.py +0 -0
  117. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/presentation_policy.py +0 -0
  118. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/refetch_state.py +0 -0
  119. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/review.py +0 -0
  120. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/review_chat.py +0 -0
  121. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/domain/submission.py +0 -0
  122. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/miniapp/__init__.py +0 -0
  123. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/miniapp/auth.py +0 -0
  124. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/miniapp/rbac.py +0 -0
  125. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/miniapp/role_bindings.py +0 -0
  126. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/miniapp/session.py +0 -0
  127. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/observability/__init__.py +0 -0
  128. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/observability/audit.py +0 -0
  129. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/observability/cli.py +0 -0
  130. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/observability/doctor.py +0 -0
  131. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/observability/errors.py +0 -0
  132. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/observability/redact.py +0 -0
  133. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/__init__.py +0 -0
  134. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/__init__.py +0 -0
  135. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/automation.py +0 -0
  136. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/columns.py +0 -0
  137. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/editorial.py +0 -0
  138. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/inbox.py +0 -0
  139. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/ledger.py +0 -0
  140. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/media_assets.py +0 -0
  141. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/moderation.py +0 -0
  142. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/novel_preview.py +0 -0
  143. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/protocol_events.py +0 -0
  144. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/recovery.py +0 -0
  145. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/refetch.py +0 -0
  146. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/reviews.py +0 -0
  147. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/storage/sqlite/submitter_notifications.py +0 -0
  148. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/__init__.py +0 -0
  149. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/callback_feedback.py +0 -0
  150. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/capture.py +0 -0
  151. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/delivery/__init__.py +0 -0
  152. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/delivery/discussion.py +0 -0
  153. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/delivery/executor.py +0 -0
  154. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/delivery/gateway.py +0 -0
  155. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/delivery/legacy_runner.py +0 -0
  156. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/delivery/planner.py +0 -0
  157. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/delivery/preparation.py +0 -0
  158. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/delivery/registry.py +0 -0
  159. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/delivery/sender.py +0 -0
  160. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/inbox_worker.py +0 -0
  161. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/preview_recovery.py +0 -0
  162. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/review_expiry.py +0 -0
  163. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/review_keyboard.py +0 -0
  164. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/review_media.py +0 -0
  165. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost/telegram/review_stager.py +0 -0
  166. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost_bot.egg-info/dependency_links.txt +0 -0
  167. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost_bot.egg-info/entry_points.txt +0 -0
  168. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost_bot.egg-info/requires.txt +0 -0
  169. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/telepost_bot.egg-info/top_level.txt +0 -0
  170. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_admin_api.py +0 -0
  171. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_album_layout.py +0 -0
  172. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_anonymous.py +0 -0
  173. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_api_commands.py +0 -0
  174. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_api_server.py +0 -0
  175. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_api_version.py +0 -0
  176. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_architecture_application.py +0 -0
  177. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_architecture_core.py +0 -0
  178. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_automation.py +0 -0
  179. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_backfill_attribution.py +0 -0
  180. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_blacklist.py +0 -0
  181. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_bot_language.py +0 -0
  182. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_bot_token_logging.py +0 -0
  183. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_botconfig.py +0 -0
  184. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_boundary.py +0 -0
  185. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_callback_contract.py +0 -0
  186. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_caption_mentions.py +0 -0
  187. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_compatibility.py +0 -0
  188. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_config_encoding.py +0 -0
  189. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_console_encoding.py +0 -0
  190. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_data_class_cleanup.py +0 -0
  191. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_database.py +0 -0
  192. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_database_first_start.py +0 -0
  193. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_database_operations.py +0 -0
  194. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_delivery_planner.py +0 -0
  195. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_discussion_uncertainty.py +0 -0
  196. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_disposition.py +0 -0
  197. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_doctor.py +0 -0
  198. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_editorial.py +0 -0
  199. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_file_validator.py +0 -0
  200. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_fly_deploy_contract.py +0 -0
  201. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_frozen_support.py +0 -0
  202. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_handlers.py +0 -0
  203. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_heat_calculator.py +0 -0
  204. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_helper_functions.py +0 -0
  205. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_hot_domain.py +0 -0
  206. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_identity_provenance.py +0 -0
  207. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_install_scripts.py +0 -0
  208. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_integration.py +0 -0
  209. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_legacy_delivery_port_navigation.py +0 -0
  210. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_logic_flow.py +0 -0
  211. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_logical_submissions.py +0 -0
  212. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_maintenance_jobs.py +0 -0
  213. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_manager_notifications.py +0 -0
  214. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_media_decision_audit.py +0 -0
  215. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_media_delivery_pipeline.py +0 -0
  216. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_media_domain.py +0 -0
  217. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_media_preparation.py +0 -0
  218. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_media_proxy_delivery.py +0 -0
  219. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_menu_shortcut_single_reply.py +0 -0
  220. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_miniapp_auth.py +0 -0
  221. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_miniapp_content.py +0 -0
  222. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_miniapp_entries.py +0 -0
  223. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_miniapp_history.py +0 -0
  224. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_miniapp_rbac.py +0 -0
  225. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_mixed_media_integrity.py +0 -0
  226. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_moderation_and_admin_ux.py +0 -0
  227. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_navigation.py +0 -0
  228. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_no_owner_probe.py +0 -0
  229. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_novel_cover_preview.py +0 -0
  230. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_novel_delivery_semantics.py +0 -0
  231. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_novel_preview.py +0 -0
  232. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_observability.py +0 -0
  233. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_observability_lifecycle.py +0 -0
  234. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_online_reading_root_button.py +0 -0
  235. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_packing_ssot.py +0 -0
  236. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_polling_server.py +0 -0
  237. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_preview_pagination.py +0 -0
  238. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_preview_recovery.py +0 -0
  239. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_protocol_contract.py +0 -0
  240. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_publication_presentation.py +0 -0
  241. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_publish_idempotency.py +0 -0
  242. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_publish_regressions.py +0 -0
  243. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_publish_reply.py +0 -0
  244. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_reaction_backfill.py +0 -0
  245. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_reaction_stats.py +0 -0
  246. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_recovery.py +0 -0
  247. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_recovery_answer_first.py +0 -0
  248. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_recovery_reconciliation.py +0 -0
  249. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_refetch.py +0 -0
  250. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_refetch_card_state.py +0 -0
  251. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_refetch_events.py +0 -0
  252. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_refetch_job_lifecycle.py +0 -0
  253. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_refetch_reason_normalization.py +0 -0
  254. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_refetch_replacement.py +0 -0
  255. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_remote_fetch_fallback.py +0 -0
  256. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_rerender.py +0 -0
  257. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_resubmit.py +0 -0
  258. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_review.py +0 -0
  259. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_review_album_payload.py +0 -0
  260. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_review_card_recovery.py +0 -0
  261. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_review_chat_contract.py +0 -0
  262. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_review_consistency.py +0 -0
  263. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_review_expiry_recovery.py +0 -0
  264. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_review_http_mcp.py +0 -0
  265. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_review_media_lifecycle.py +0 -0
  266. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_review_service.py +0 -0
  267. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_robustness.py +0 -0
  268. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_run_dispatcher.py +0 -0
  269. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_run_mode.py +0 -0
  270. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_run_supervisor.py +0 -0
  271. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_schedule_outcomes.py +0 -0
  272. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_search_disabled_hint.py +0 -0
  273. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_search_recovery.py +0 -0
  274. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_security.py +0 -0
  275. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_security_headers.py +0 -0
  276. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_session_database_handles.py +0 -0
  277. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_shutdown.py +0 -0
  278. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_staging_recovery.py +0 -0
  279. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_streaming_uploads.py +0 -0
  280. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_submission_timeout_idempotency.py +0 -0
  281. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_telegram_golden_messages.py +0 -0
  282. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_telegram_media_cache.py +0 -0
  283. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_telepress_contract.py +0 -0
  284. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_user_friendly_messages.py +0 -0
  285. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_webhook_payload_admission.py +0 -0
  286. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_webhook_ready.py +0 -0
  287. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_webhook_registration.py +0 -0
  288. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_webhook_router.py +0 -0
  289. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_webhook_secret.py +0 -0
  290. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_webhook_secret_logging.py +0 -0
  291. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_webhook_static.py +0 -0
  292. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/tests/test_work_id_wire.py +0 -0
  293. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/ui/__init__.py +0 -0
  294. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/ui/i18n.py +0 -0
  295. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/ui/keyboards.py +0 -0
  296. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/__init__.py +0 -0
  297. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/api_tokens.py +0 -0
  298. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/blacklist.py +0 -0
  299. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/cache.py +0 -0
  300. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/config_wizard.py +0 -0
  301. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/console.py +0 -0
  302. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/database.py +0 -0
  303. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/file_validator.py +0 -0
  304. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/heat_calculator.py +0 -0
  305. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/helper_functions.py +0 -0
  306. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/index_manager.py +0 -0
  307. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/logging_config.py +0 -0
  308. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/maintenance_jobs.py +0 -0
  309. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/polling_server.py +0 -0
  310. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/run_mode.py +0 -0
  311. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/runtime_policy.py +0 -0
  312. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/schedule_watchdog.py +0 -0
  313. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/search_engine.py +0 -0
  314. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/security_headers.py +0 -0
  315. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/submission.py +0 -0
  316. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/utils/webhook_server.py +0 -0
  317. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/webapp/__init__.py +0 -0
  318. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/webapp/dist/assets/2d82b92e720462f8dd3b-Bh4Fahcw.svg +0 -0
  319. {telepost_bot-2.85.0 → telepost_bot-2.85.1}/webapp/dist/assets/index-CLfkW8eZ.css +0 -0
@@ -8,6 +8,13 @@
8
8
  > 发布说明面向普通用户:写「对用户有什么改变」,不写内部实现细节(模块名、函数名、配置键);
9
9
  > 技术细节放进代码注释或 `docs/`。每个 Release 的正文由本文件对应版本段自动生成。
10
10
 
11
+ ## [2.85.1](https://github.com/redtidev1918/TelePost/compare/v2.85.0...v2.85.1) (2026-11-29)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **chat:** clarify the next step for submission drafts ([#403](https://github.com/redtidev1918/TelePost/issues/403)) ([38e4148](https://github.com/redtidev1918/TelePost/commit/38e4148cfdd5bf360912fa378fd692cac67f3fdd))
17
+
11
18
  ## [2.85.0](https://github.com/redtidev1918/TelePost/compare/v2.84.15...v2.85.0) (2026-11-28)
12
19
 
13
20
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: telepost-bot
3
- Version: 2.85.0
3
+ Version: 2.85.1
4
4
  Summary: Telegram submission, review, and publication bot with a Mini App, HTTP API, and multi-bot supervisor.
5
5
  Author: redtidev1918
6
6
  License-Expression: MIT
@@ -126,7 +126,7 @@ TelePost 是开源、自托管的 Telegram 频道投稿与审核 Bot,支持私
126
126
  `./telepost-linux-x64` 或 `./telepost-macos-arm64`;pip 用 `telepost`。
127
127
  Docker 用户按安装指南配置环境变量,无需运行向导或编辑 `config.ini`。
128
128
  4. **发起第一次投稿**:直接私聊 Bot 发送或转发图片、视频、GIF、音频或文件。可连续发送
129
- 多个附件,完成后点「打开预览」。附件自带的说明会带进简介,说明里的 `#标签` 会自动加入。
129
+ 多个附件,发完按回执提示填写标签或预览投稿。附件自带的说明会带进简介,说明里的 `#标签` 会自动加入。
130
130
  至少一个附件和一个标签即可投稿。检查后点「✅ 确认发布」(开启聊天审核后为「✅ 提交审核」)。
131
131
 
132
132
  全部命令见[命令参考](https://github.com/redtidev1918/TelePost/blob/main/docs/COMMANDS.md)。
@@ -86,7 +86,7 @@ See the [Installation guide](https://github.com/redtidev1918/TelePost/blob/main/
86
86
  `./telepost-macos-arm64` on Linux / macOS; `telepost` for pip. Docker users configure
87
87
  environment variables as described in the installation guide; no wizard or `config.ini` is required.
88
88
  4. **Make a first submission**: Send or forward photos, videos, GIFs, audio or files in a private
89
- chat with the bot, then tap **Open preview**. The attachment caption can fill the note, and its
89
+ chat with the bot, then follow the reply to add tags or preview the draft. The attachment caption can fill the note, and its
90
90
  hashtags are imported automatically. Check that you have at least one attachment and one tag,
91
91
  then tap **✅ Publish** (or **✅ Submit for review** when chat review is on).
92
92
 
@@ -78,7 +78,7 @@ TelePost 是开源、自托管的 Telegram 频道投稿与审核 Bot,支持私
78
78
  `./telepost-linux-x64` 或 `./telepost-macos-arm64`;pip 用 `telepost`。
79
79
  Docker 用户按安装指南配置环境变量,无需运行向导或编辑 `config.ini`。
80
80
  4. **发起第一次投稿**:直接私聊 Bot 发送或转发图片、视频、GIF、音频或文件。可连续发送
81
- 多个附件,完成后点「打开预览」。附件自带的说明会带进简介,说明里的 `#标签` 会自动加入。
81
+ 多个附件,发完按回执提示填写标签或预览投稿。附件自带的说明会带进简介,说明里的 `#标签` 会自动加入。
82
82
  至少一个附件和一个标签即可投稿。检查后点「✅ 确认发布」(开启聊天审核后为「✅ 提交审核」)。
83
83
 
84
84
  全部命令见[命令参考](https://github.com/redtidev1918/TelePost/blob/main/docs/COMMANDS.md)。
@@ -755,7 +755,8 @@ async def init_db():
755
755
  heat_score REAL DEFAULT 0,
756
756
  last_update REAL,
757
757
  related_message_ids TEXT,
758
- is_deleted INTEGER DEFAULT 0
758
+ is_deleted INTEGER DEFAULT 0,
759
+ direct_submitter_user_id INTEGER
759
760
  )
760
761
  ''')
761
762
 
@@ -766,6 +767,15 @@ async def init_db():
766
767
  except Exception:
767
768
  # 字段已存在,忽略错误
768
769
  pass
770
+
771
+ post_columns = await conn.execute('PRAGMA table_info(published_posts)')
772
+ if "direct_submitter_user_id" not in {row[1] for row in await post_columns.fetchall()}:
773
+ await conn.execute('ALTER TABLE published_posts ADD COLUMN direct_submitter_user_id INTEGER')
774
+ await conn.execute(
775
+ 'CREATE INDEX IF NOT EXISTS idx_posts_direct_submitter '
776
+ 'ON published_posts(direct_submitter_user_id, publish_time DESC, message_id DESC) '
777
+ 'WHERE direct_submitter_user_id IS NOT NULL'
778
+ )
769
779
 
770
780
  # 创建索引以提升查询性能
771
781
  await conn.execute('CREATE INDEX IF NOT EXISTS idx_heat_score ON published_posts(heat_score DESC)')
@@ -129,7 +129,7 @@ async def handle_menu_shortcuts(update: Update, context: CallbackContext) -> Non
129
129
  from handlers.search_handlers import handle_search_input
130
130
  await handle_search_input(update, context)
131
131
  handled = True
132
- # 开始投稿:已由 ConversationHandler 的 entry(Regex「开始投稿」)接管,
132
+ # 开始投稿:已由 ConversationHandler 的菜单处理器接管,
133
133
  # 这里不再直接调 submit——直接调只建 DB 会话、不建立状态机内存状态,
134
134
  # 用户随后发的媒体会掉出状态机而静默无响应。
135
135
  # 我的统计
@@ -15,7 +15,14 @@ from telegram.ext import (
15
15
 
16
16
  from models.state import STATE
17
17
  from handlers.mode_selection import submit
18
- from handlers.upload import handle_private_upload, handle_upload, done_upload, skip_upload, prompt_upload
18
+ from handlers.upload import (
19
+ done_upload,
20
+ handle_private_upload,
21
+ handle_upload,
22
+ open_submission_menu,
23
+ prompt_upload,
24
+ skip_upload,
25
+ )
19
26
  from handlers.preview_handlers import (
20
27
  handle_edit_field_callback,
21
28
  handle_edit_input,
@@ -24,22 +31,39 @@ from handlers.preview_handlers import (
24
31
  )
25
32
  from handlers.publish import publish_submission
26
33
  from handlers.command_handlers import cancel
34
+ from handlers.submission_controls import answer_stale_submission, clear_control, is_current_control
27
35
 
28
36
  _SUBMISSION_MEDIA = filters.UpdateType.MESSAGE & (
29
37
  filters.PHOTO | filters.VIDEO | filters.ANIMATION | filters.AUDIO
30
38
  | filters.Document.ALL
31
39
  )
32
40
  PRIVATE_SUBMISSION_MEDIA = filters.ChatType.PRIVATE & _SUBMISSION_MEDIA
41
+ SUBMISSION_MENU = filters.UpdateType.MESSAGE & filters.TEXT & ~filters.COMMAND & filters.Regex(
42
+ r"^\s*(?:📝\s*)?(?:开始投稿|New submission)\s*$",
43
+ )
33
44
 
34
45
 
35
46
  def _exclusive(callback):
36
47
  """Commit the next conversation state and stop later handler groups."""
37
48
  async def exclusive(update, context):
38
- raise ApplicationHandlerStop(await callback(update, context))
49
+ next_state = await callback(update, context)
50
+ if next_state == ConversationHandler.END:
51
+ clear_control(context)
52
+ raise ApplicationHandlerStop(next_state)
39
53
 
40
54
  return exclusive
41
55
 
42
56
 
57
+ def _current_control(callback):
58
+ async def checked(update, context):
59
+ if not is_current_control(update, context):
60
+ await answer_stale_submission(update, context)
61
+ return None
62
+ return await callback(update, context)
63
+
64
+ return _exclusive(checked)
65
+
66
+
43
67
  def build_submission_conversation(*, persistent: bool = False) -> ConversationHandler:
44
68
  """构建私聊附件、/submit 与「开始投稿」共用的投稿会话。
45
69
 
@@ -50,35 +74,34 @@ def build_submission_conversation(*, persistent: bool = False) -> ConversationHa
50
74
  private_upload = MessageHandler(
51
75
  PRIVATE_SUBMISSION_MEDIA, _exclusive(handle_private_upload),
52
76
  )
77
+ menu = MessageHandler(SUBMISSION_MENU, _exclusive(open_submission_menu))
53
78
  return ConversationHandler(
54
79
  entry_points=[
55
80
  private_upload,
56
81
  CommandHandler("submit", _exclusive(submit)),
57
- # 底部菜单按钮"📝 开始投稿"(ReplyKeyboard 文本)必须作为 entry 进入
58
- # 状态机,否则只建 DB 会话、不建立内存状态,随后媒体会掉出状态机。
59
- MessageHandler(
60
- filters.TEXT & ~filters.COMMAND & filters.Regex(r"(?:开始投稿|New submission)\s*$"),
61
- _exclusive(submit),
62
- ),
82
+ menu,
63
83
  ],
64
84
  states={
65
85
  STATE["UPLOAD"]: [
86
+ menu,
66
87
  CommandHandler("done_media", _exclusive(done_upload)),
67
88
  CommandHandler("skip_media", _exclusive(skip_upload)),
68
- CallbackQueryHandler(_exclusive(done_upload), pattern="^submission_preview$"),
89
+ CallbackQueryHandler(_current_control(done_upload), pattern="^submission_(preview|tags)$"),
69
90
  private_upload,
70
91
  MessageHandler(_SUBMISSION_MEDIA, _exclusive(handle_upload)),
71
92
  MessageHandler(filters.TEXT & ~filters.COMMAND, _exclusive(prompt_upload)),
72
93
  ],
73
94
  STATE["PREVIEW"]: [
95
+ menu,
74
96
  private_upload,
75
- CallbackQueryHandler(_exclusive(publish_submission), pattern="^publish$"),
76
- CallbackQueryHandler(_exclusive(cancel), pattern="^cancel$"),
77
- CallbackQueryHandler(_exclusive(handle_toggle_anon), pattern="^toggle_anon$"),
78
- CallbackQueryHandler(_exclusive(handle_toggle_spoiler), pattern="^toggle_spoiler$"),
79
- CallbackQueryHandler(_exclusive(handle_edit_field_callback), pattern="^edit_(tag|title|note|link|media)$"),
97
+ CallbackQueryHandler(_current_control(publish_submission), pattern="^publish$"),
98
+ CallbackQueryHandler(_current_control(cancel), pattern="^cancel$"),
99
+ CallbackQueryHandler(_current_control(handle_toggle_anon), pattern="^toggle_anon$"),
100
+ CallbackQueryHandler(_current_control(handle_toggle_spoiler), pattern="^toggle_spoiler$"),
101
+ CallbackQueryHandler(_current_control(handle_edit_field_callback), pattern="^edit_(tag|title|note|link|media)$"),
80
102
  ],
81
103
  STATE["EDIT"]: [
104
+ menu,
82
105
  private_upload,
83
106
  MessageHandler(filters.TEXT & ~filters.COMMAND, _exclusive(handle_edit_input)),
84
107
  MessageHandler(_SUBMISSION_MEDIA, _exclusive(handle_edit_input)),
@@ -20,20 +20,22 @@ from config.settings import (
20
20
  MAX_SUBMISSION_FILES,
21
21
  )
22
22
  from models.state import STATE
23
+ from handlers.submission_controls import clear_control
23
24
  from utils.blacklist import is_blacklisted
24
25
  from utils.submission import create_session
25
26
 
26
27
  logger = logging.getLogger(__name__)
27
28
 
28
29
 
29
- async def can_start_submission(update: Update, context: CallbackContext) -> bool:
30
+ async def can_start_submission(update: Update, context: CallbackContext, *,
31
+ consume_quota: bool = True) -> bool:
30
32
  user_id = update.effective_user.id
31
33
  if is_blacklisted(user_id):
32
34
  await update.message.reply_text(tr('⚠️ 您已被列入黑名单,无法投稿。'))
33
35
  return False
34
36
 
35
37
  # 投稿频率限制(内存滑动窗口,重启清零)
36
- if SUBMIT_LIMIT_PER_HOUR > 0:
38
+ if consume_quota and SUBMIT_LIMIT_PER_HOUR > 0:
37
39
  import time as _t
38
40
  now = _t.time()
39
41
  history = context.bot_data.setdefault("submit_times", {}).setdefault(user_id, [])
@@ -64,6 +66,7 @@ async def submit(update: Update, context: CallbackContext) -> int:
64
66
  # 每次 /submit 是一次新投稿:清除上一个会话的“已发媒体预览”标记,
65
67
  # 否则再次投稿时真实媒体预览不会重新发送。
66
68
  context.user_data.pop("preview_media_sent", None)
69
+ clear_control(context)
67
70
 
68
71
  await update.message.reply_text(_upload_hint(BOT_MODE), parse_mode="HTML", reply_markup=ReplyKeyboardRemove())
69
72
  return STATE["UPLOAD"]
@@ -16,8 +16,10 @@ from telegram import (
16
16
  InputMediaPhoto,
17
17
  InputMediaVideo,
18
18
  )
19
+ from telegram.error import BadRequest, TelegramError
19
20
  from telegram.ext import ConversationHandler, CallbackContext
20
21
 
22
+ from handlers.submission_controls import clear_control, remember_control
21
23
  from models.state import STATE
22
24
  from utils.helper_functions import process_tags, parse_json_list
23
25
  from telepost.application.publication import channel_caption
@@ -157,12 +159,13 @@ async def show_submission_preview(update: Update, context: CallbackContext, *,
157
159
  """展示/刷新预览;回调编辑原消息,文本来源发送新消息。"""
158
160
  user_id = update.effective_user.id
159
161
  row = await get_session(user_id)
162
+ message = update.effective_message
163
+ clear_control(context)
160
164
  if row is None:
161
165
  try:
162
- target = update.callback_query if update.callback_query else update.effective_message
163
- await target.reply_text(MessageFormatter.session_expired())
164
- except Exception:
165
- pass
166
+ await message.reply_text(MessageFormatter.session_expired())
167
+ except TelegramError:
168
+ logger.debug("发送投稿过期提示失败", exc_info=True)
166
169
  return ConversationHandler.END
167
170
 
168
171
  text = _build_preview_text(row)
@@ -171,19 +174,28 @@ async def show_submission_preview(update: Update, context: CallbackContext, *,
171
174
  await _send_preview_media(
172
175
  update, context, parse_json_list(row["image_id"]), parse_json_list(row["document_id"]),
173
176
  )
177
+ markup = {"reply_markup": keyboard, "parse_mode": "HTML", "link_preview_options": NO_LINK_PREVIEW}
174
178
  if update.callback_query:
175
179
  try:
176
- await update.callback_query.edit_message_text(
177
- text, reply_markup=keyboard, parse_mode="HTML",
178
- link_preview_options=NO_LINK_PREVIEW,
179
- )
180
- except Exception as e:
181
- logger.debug(f"刷新预览失败(内容未变化时属正常): {e}")
182
- else:
183
- await update.effective_message.reply_text(
184
- text, reply_markup=keyboard, parse_mode="HTML",
185
- link_preview_options=NO_LINK_PREVIEW,
186
- )
180
+ await update.callback_query.edit_message_text(text, **markup)
181
+ except BadRequest as exc:
182
+ if "message is not modified" in str(exc).lower():
183
+ remember_control(context, message.chat_id, message.message_id)
184
+ return STATE["PREVIEW"]
185
+ logger.debug("原投稿消息不可编辑,发送新预览", exc_info=True)
186
+ except TelegramError:
187
+ logger.warning("无法刷新投稿预览,草稿仍可从菜单打开", exc_info=True)
188
+ return STATE["UPLOAD"]
189
+ else:
190
+ remember_control(context, message.chat_id, message.message_id)
191
+ return STATE["PREVIEW"]
192
+
193
+ try:
194
+ sent = await message.reply_text(text, **markup)
195
+ except TelegramError:
196
+ logger.warning("无法发送投稿预览,草稿仍可从菜单打开", exc_info=True)
197
+ return STATE["UPLOAD"]
198
+ remember_control(context, message.chat_id, sent.message_id)
187
199
  return STATE["PREVIEW"]
188
200
 
189
201
 
@@ -193,18 +205,24 @@ async def handle_edit_field_callback(update: Update, context: CallbackContext) -
193
205
  prompt = MessageFormatter.edit_prompt(field) if field in _EDIT_FIELDS else None
194
206
  if not prompt:
195
207
  return STATE["PREVIEW"]
196
- context.user_data["edit_field"] = field
197
208
  try:
198
209
  await update.callback_query.answer()
199
210
  except Exception:
200
211
  pass
212
+ return await begin_field_edit(update, context, field, prompt)
213
+
214
+
215
+ async def begin_field_edit(update: Update, context: CallbackContext, field: str, prompt: str) -> int:
216
+ clear_control(context)
201
217
  try:
202
- await update.callback_query.edit_message_text(prompt, parse_mode="HTML")
203
- except Exception:
204
218
  try:
219
+ await update.callback_query.edit_message_text(prompt, parse_mode="HTML")
220
+ except BadRequest:
205
221
  await update.effective_message.reply_text(prompt, parse_mode="HTML")
206
- except Exception:
207
- await update.effective_message.reply_text(prompt)
222
+ except TelegramError:
223
+ logger.warning("无法发送投稿编辑提示,草稿仍可从菜单打开", exc_info=True)
224
+ return STATE["UPLOAD"]
225
+ context.user_data["edit_field"] = field
208
226
  return STATE["EDIT"]
209
227
 
210
228
 
@@ -634,6 +634,7 @@ async def save_published_post(user_id, message_id, data, media_list, doc_list,
634
634
  media_compact=list(media_list or []),
635
635
  document_compact=list(doc_list or []),
636
636
  all_message_ids=list(all_message_ids or []),
637
+ direct_submitter_user_id=col("direct_submitter_user_id", None),
637
638
  )
638
639
  try:
639
640
  return await record_published_post(post)
@@ -688,6 +689,8 @@ async def publish_from_files(bot, files, *, tags="", title="", note="", link="",
688
689
  submitter_username=submitter_username,
689
690
  submitter_display_name=submitter_display_name, source=source,
690
691
  )
692
+ if source == "miniapp":
693
+ data["direct_submitter_user_id"] = submitter_user_id
691
694
 
692
695
  service = PublicationService(
693
696
  delivery=_LegacyDeliveryPort(bot, reclassify_local=True),
@@ -804,6 +807,8 @@ async def publish_from_file_ids(bot, media, documents, *, tags="", title="",
804
807
  + ["document"] * len(documents)
805
808
  ),
806
809
  )
810
+ if source == "miniapp" and not review_chain_id:
811
+ data["direct_submitter_user_id"] = submitter_user_id
807
812
  media_compact = [f"{m['type']}:{m['file_id']}" for m in media]
808
813
  doc_compact = [
809
814
  f"document:{d['file_id']}:{d.get('filename', 'file')}" for d in documents
@@ -1354,7 +1359,7 @@ async def publish_submission(update: Update, context: CallbackContext) -> int:
1354
1359
  publish_success = True
1355
1360
 
1356
1361
  await save_published_post(
1357
- user_id, sent_message.message_id, data,
1362
+ user_id, sent_message.message_id, {**dict(data), "direct_submitter_user_id": user_id},
1358
1363
  media_list, doc_list, all_message_ids,
1359
1364
  )
1360
1365
 
@@ -0,0 +1,36 @@
1
+ """Bind Telegram buttons to the current submission message in PTB user data."""
2
+
3
+ from telepost.telegram.callback_feedback import answer_callback
4
+ from ui.i18n import tr
5
+
6
+
7
+ SUBMISSION_CALLBACKS = r"^(?:submission_(?:preview|tags)|publish|cancel|toggle_(?:anon|spoiler)|edit_(?:tag|title|note|link|media))$"
8
+ _CONTROL = "submission_control_message"
9
+
10
+
11
+ def remember_control(context, chat_id: int, message_id: int) -> None:
12
+ user_data = getattr(context, "user_data", None)
13
+ if user_data is not None:
14
+ user_data[_CONTROL] = (chat_id, message_id)
15
+
16
+
17
+ def clear_control(context) -> None:
18
+ user_data = getattr(context, "user_data", None)
19
+ if user_data is not None:
20
+ user_data.pop(_CONTROL, None)
21
+
22
+
23
+ def is_current_control(update, context) -> bool:
24
+ message = update.effective_message
25
+ return (
26
+ message is not None
27
+ and context.user_data.get(_CONTROL) == (message.chat_id, message.message_id)
28
+ )
29
+
30
+
31
+ async def answer_stale_submission(update, context) -> None:
32
+ await answer_callback(
33
+ update.callback_query,
34
+ tr('这个按钮已过期。请用最近一条投稿消息上的按钮,或点「开始投稿」继续。'),
35
+ show_alert=True,
36
+ )
@@ -6,7 +6,7 @@ utils.submission.classify_message 单一实现,媒体与文档共享一个状
6
6
  """
7
7
  import logging
8
8
 
9
- from telegram import InlineKeyboardButton, InlineKeyboardMarkup, MessageEntity, Update
9
+ from telegram import InlineKeyboardButton, InlineKeyboardMarkup, MessageEntity, ReplyKeyboardRemove, Update
10
10
  from telegram.error import TelegramError
11
11
  from telegram.ext import ConversationHandler, CallbackContext
12
12
 
@@ -19,7 +19,8 @@ from config.settings import (
19
19
  MAX_SUBMISSION_FILES,
20
20
  )
21
21
  from models.state import STATE
22
- from handlers.mode_selection import can_start_submission
22
+ from handlers.mode_selection import can_start_submission, submit
23
+ from handlers.submission_controls import clear_control, remember_control
23
24
  from ui.i18n import tr
24
25
  from ui.messages import MessageFormatter
25
26
  from utils.file_validator import create_file_validator
@@ -30,12 +31,51 @@ logger = logging.getLogger(__name__)
30
31
  _file_validator = create_file_validator(ALLOWED_FILE_TYPES, BLOCKED_FILE_TYPES)
31
32
 
32
33
 
33
- def _upload_actions() -> InlineKeyboardMarkup:
34
+ def _upload_actions(has_tags: bool) -> InlineKeyboardMarkup:
34
35
  return InlineKeyboardMarkup([[
35
- InlineKeyboardButton(tr('打开预览'), callback_data="submission_preview"),
36
+ InlineKeyboardButton(
37
+ tr('预览投稿') if has_tags else tr('填写标签'),
38
+ callback_data="submission_preview" if has_tags else "submission_tags",
39
+ ),
36
40
  ]])
37
41
 
38
42
 
43
+ async def _send_upload_control(message, context, text: str, has_tags: bool) -> None:
44
+ clear_control(context)
45
+ try:
46
+ sent = await message.reply_text(
47
+ text, parse_mode="HTML", reply_markup=_upload_actions(has_tags),
48
+ )
49
+ except TelegramError:
50
+ logger.warning("投稿草稿已保存,发送操作按钮失败", exc_info=True)
51
+ else:
52
+ remember_control(context, message.chat_id, sent.message_id)
53
+
54
+
55
+ async def open_submission_menu(update: Update, context: CallbackContext) -> int:
56
+ """打开投稿菜单入口,存在草稿时恢复上传操作。"""
57
+ draft = await get_session(update.effective_user.id)
58
+ if draft is None:
59
+ return await submit(update, context)
60
+ if not await can_start_submission(update, context, consume_quota=False):
61
+ return ConversationHandler.END
62
+ context.user_data.pop("edit_field", None)
63
+ total = len(_parse(draft["image_id"])) + len(_parse(draft["document_id"]))
64
+ if total:
65
+ has_tags = bool((draft["tags"] or "").strip())
66
+ await _send_upload_control(
67
+ update.message, context, MessageFormatter.upload_received(total, has_tags=has_tags),
68
+ has_tags,
69
+ )
70
+ else:
71
+ clear_control(context)
72
+ await update.message.reply_text(
73
+ MessageFormatter.submit_hint(BOT_MODE, MAX_SUBMISSION_FILES), parse_mode="HTML",
74
+ reply_markup=ReplyKeyboardRemove(),
75
+ )
76
+ return STATE["UPLOAD"]
77
+
78
+
39
79
  async def handle_private_upload(update: Update, context: CallbackContext) -> int | None:
40
80
  return await handle_upload(update, context, auto_start=True)
41
81
 
@@ -81,6 +121,7 @@ async def handle_upload(update: Update, context: CallbackContext, *,
81
121
  return unchanged
82
122
 
83
123
  session = await get_session(user_id)
124
+ has_tags = bool(session and (session["tags"] or "").strip())
84
125
  start_options = {}
85
126
  other_count = 0
86
127
  if session is None:
@@ -98,9 +139,8 @@ async def handle_upload(update: Update, context: CallbackContext, *,
98
139
  doc_count = len(_parse(session["document_id"]))
99
140
  other_count = media_count if kind == "document" else doc_count
100
141
  if media_count + doc_count >= MAX_SUBMISSION_FILES:
101
- await message.reply_text(
102
- MessageFormatter.upload_max_files(MAX_SUBMISSION_FILES),
103
- parse_mode="HTML", reply_markup=_upload_actions(),
142
+ await _send_upload_control(
143
+ message, context, MessageFormatter.upload_max_files(MAX_SUBMISSION_FILES), has_tags,
104
144
  )
105
145
  return STATE["UPLOAD"]
106
146
 
@@ -119,9 +159,12 @@ async def handle_upload(update: Update, context: CallbackContext, *,
119
159
  await message.reply_text(MessageFormatter.session_expired(), parse_mode="HTML")
120
160
  return ConversationHandler.END
121
161
 
122
- await message.reply_text(
123
- MessageFormatter.upload_received(kind, count + other_count, MAX_SUBMISSION_FILES),
124
- parse_mode="HTML", reply_markup=_upload_actions(),
162
+ if hashtags and not has_tags:
163
+ draft = await get_session(user_id)
164
+ has_tags = bool(draft and (draft["tags"] or "").strip())
165
+ await _send_upload_control(
166
+ message, context, MessageFormatter.upload_received(count + other_count, has_tags=has_tags),
167
+ has_tags,
125
168
  )
126
169
  return STATE["UPLOAD"]
127
170
 
@@ -130,11 +173,16 @@ async def done_upload(update: Update, context: CallbackContext) -> int:
130
173
  """完成上传:校验至少有内容后进入预览。"""
131
174
  user_id = update.effective_user.id
132
175
  session = await get_session(user_id)
133
- if update.callback_query:
176
+ query = update.callback_query
177
+ start_tag_edit = (
178
+ query and query.data == "submission_tags"
179
+ and session and not (session["tags"] or "").strip()
180
+ )
181
+ if query:
134
182
  try:
135
- await update.callback_query.answer()
183
+ await query.answer()
136
184
  except TelegramError:
137
- logger.debug("上传预览按钮确认失败", exc_info=True)
185
+ logger.debug("上传继续按钮确认失败", exc_info=True)
138
186
  message = update.effective_message
139
187
  if session is None:
140
188
  await message.reply_text(MessageFormatter.session_expired(), parse_mode="HTML")
@@ -153,7 +201,9 @@ async def done_upload(update: Update, context: CallbackContext) -> int:
153
201
  await message.reply_text(MessageFormatter.upload_requires_content("any"), parse_mode="HTML")
154
202
  return STATE["UPLOAD"]
155
203
 
156
- from handlers.preview_handlers import show_submission_preview
204
+ from handlers.preview_handlers import begin_field_edit, show_submission_preview
205
+ if start_tag_edit:
206
+ return await begin_field_edit(update, context, "edit_tag", MessageFormatter.upload_tags_prompt())
157
207
  return await show_submission_preview(update, context, include_media=True)
158
208
 
159
209
 
@@ -164,9 +214,7 @@ async def skip_upload(update: Update, context: CallbackContext) -> int:
164
214
 
165
215
  async def prompt_upload(update: Update, context: CallbackContext) -> int:
166
216
  """上传阶段收到文字时的提示。"""
167
- await update.message.reply_text(
168
- MessageFormatter.prompt_upload_text(), parse_mode="HTML", reply_markup=_upload_actions(),
169
- )
217
+ await update.message.reply_text(MessageFormatter.prompt_upload_text(), parse_mode="HTML")
170
218
  return STATE["UPLOAD"]
171
219
 
172
220
 
@@ -189,9 +189,9 @@ async def check_conversation_timeout(update: Update, context: CallbackContext) -
189
189
  except Exception as e:
190
190
  logger.error(f"发送超时通知失败: {e}")
191
191
 
192
- from handlers.conversation import PRIVATE_SUBMISSION_MEDIA
193
- if PRIVATE_SUBMISSION_MEDIA.check_update(update):
194
- return # 用这条新附件开始下一份投稿。
192
+ from handlers.conversation import PRIVATE_SUBMISSION_MEDIA, SUBMISSION_MENU
193
+ if (PRIVATE_SUBMISSION_MEDIA | SUBMISSION_MENU).check_update(update):
194
+ return # 本次发来的附件或菜单操作继续开启下一份投稿。
195
195
  # 普通文字收到超时通知后不再进入后续处理器。
196
196
  raise ApplicationHandlerStop()
197
197
 
@@ -827,6 +827,10 @@ def setup_application(application):
827
827
  application.add_handler(
828
828
  CallbackQueryHandler(handle_automation_wizard, pattern=r"^autowiz"), group=3
829
829
  )
830
+ from handlers.submission_controls import SUBMISSION_CALLBACKS, answer_stale_submission
831
+ application.add_handler(
832
+ CallbackQueryHandler(answer_stale_submission, pattern=SUBMISSION_CALLBACKS), group=3,
833
+ )
830
834
  application.add_handler(CallbackQueryHandler(handle_unknown_callback), group=3)
831
835
 
832
836
  # §refetch-lifecycle 作业心跳:重抓是一等持久 Job,30 秒一轮(远小于最小
@@ -33,6 +33,7 @@ class PublishedPostInput:
33
33
  media_compact: Optional[List[str]] = None # legacy "kind:file_id" strings
34
34
  document_compact: Optional[List[str]] = None # legacy "document:file_id:name"
35
35
  all_message_ids: Optional[List[int]] = None
36
+ direct_submitter_user_id: Optional[int] = None
36
37
 
37
38
 
38
39
  def content_type_of(media_compact, document_compact) -> str:
@@ -84,6 +85,7 @@ async def record_published_post(post: PublishedPostInput) -> Optional[int]:
84
85
  caption=caption,
85
86
  filename=filenames_of(docs),
86
87
  related_message_ids=post.all_message_ids or [],
88
+ direct_submitter_user_id=post.direct_submitter_user_id,
87
89
  )
88
90
  repo = PublishedPostRepository()
89
91
  post_id = await repo.insert(record)
@@ -8,7 +8,7 @@ to the entry points; when present it overrides these committed defaults.
8
8
  # Bumped automatically by release-please (extra-files in
9
9
  # release-please-config.json). Release bundles and images override it at build
10
10
  # time with the exact version/commit; this constant is the local-dev fallback.
11
- RELEASE_VERSION = "2.85.0" # x-release-please-version
11
+ RELEASE_VERSION = "2.85.1" # x-release-please-version
12
12
  RELEASE_COMMIT = "dev"
13
13
  BUILD_DATE = "dev"
14
14
  SERVICE = "telepost"