aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/cli/members.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/cli/members.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/cli/members.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/cli/members.py b/packages/meshbay-node/src/meshbay_node/cli/members.py
index ba68056..5d26bd0 100644
--- a/packages/meshbay-node/src/meshbay_node/cli/members.py
+++ b/packages/meshbay-node/src/meshbay_node/cli/members.py
@@ -62,18 +62,15 @@ def member(args) -> None:
print("which is what turning the old switch off meant.")
sys.exit(1)
- if not args.target:
- print(f"usage: meshbay-node member {sub} <username>")
- sys.exit(1)
-
if sub == "invite" and args.link:
- # A link for someone who may have no account yet, bound to their
- # address on the hub. The code and the ticket are both in it, so
- # it goes to them and to nobody else — the CLI mails nothing.
+ # A link for someone who may have no account yet, redeemable by the
+ # first account that opens it. The code and the ticket are both in
+ # it, so it goes to them and to nobody else — the CLI mails nothing.
+ # The address, if given, only labels the link in the owner's list.
group_id = _resolve_group(cfg, args.group)
+ query = f"?email={quote(args.target)}" if args.target else ""
out = _daemon_api(
- cfg, f"/api/groups/{group_id}/invite-links?email={quote(args.target)}",
- method="POST")
+ cfg, f"/api/groups/{group_id}/invite-links{query}", method="POST")
from meshbay_node.roster import write_code_file
write_code_file(cfg.data_dir, out["link"], out.get("expires_at", ""),
name="invite-link")
@@ -81,11 +78,15 @@ def member(args) -> None:
print(f"valid until {out.get('expires_at', '?')}")
print(f"cancel with meshbay-node member cancel {out['invite_id']}")
print()
- print(f"Send it to {args.target} yourself. It works once, and only for an")
- print("account registered with that address: they open it, create their")
- print("account or sign in, and land in the group without typing a code.")
+ print("Send it yourself, by any messaging app. It works once, for seven")
+ print("days, for whoever opens it first: they create their account or")
+ print("sign in, and land in the group without typing a code.")
return
+ if not args.target:
+ print(f"usage: meshbay-node member {sub} <username>")
+ sys.exit(1)
+
if sub == "invite":
group_id = _resolve_group(cfg, args.group)
out = _daemon_api(