dfd
This commit is contained in:
@@ -336,6 +336,18 @@ def _resolve_upload_path(item: Any, config: Dict[str, Any]) -> Optional[str]:
|
||||
def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
# Internal stage: send previously selected items to selected rooms.
|
||||
if any(str(a).lower() == "-send" for a in (args or [])):
|
||||
# Ensure we don't re-print the rooms picker table on the send stage.
|
||||
try:
|
||||
if hasattr(ctx, "set_last_result_table_overlay"):
|
||||
ctx.set_last_result_table_overlay(None, None, None)
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
if hasattr(ctx, "set_current_stage_table"):
|
||||
ctx.set_current_stage_table(None)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
rooms = _normalize_to_list(result)
|
||||
room_ids: List[str] = []
|
||||
for r in rooms:
|
||||
@@ -430,7 +442,7 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
log("No joined rooms found.", file=sys.stderr)
|
||||
return 0
|
||||
|
||||
table = ResultTable("Matrix Rooms")
|
||||
table = ResultTable("Matrix Rooms (select with @N)")
|
||||
table.set_table("matrix")
|
||||
table.set_source_command(".matrix", [])
|
||||
|
||||
@@ -461,12 +473,6 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
ctx.set_last_result_table_overlay(table, room_items)
|
||||
ctx.set_current_stage_table(table)
|
||||
ctx.set_pending_pipeline_tail([[".matrix", "-send"]], ".matrix")
|
||||
|
||||
print()
|
||||
from rich_display import stdout_console
|
||||
|
||||
stdout_console().print(table)
|
||||
print("\nSelect room(s) with @N (e.g. @1 or @1-3) to send the selected item(s)")
|
||||
return 0
|
||||
|
||||
CMDLET = Cmdlet(
|
||||
|
||||
Reference in New Issue
Block a user