antenna-fyi 1.2.10 → 1.2.11
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.
- package/lib/cli.js +6 -3
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -63,7 +63,8 @@ export async function handleScan(f) {
|
|
|
63
63
|
|
|
64
64
|
export async function handleProfile(f) {
|
|
65
65
|
if (!f.id) return console.error("Usage: antenna profile --id telegram:123 [--name Yi --emoji 🦦 --line1 '...' --line2 '...' --line3 '...']");
|
|
66
|
-
if (f.name || f.line1 || f.line2 || f.line3) {
|
|
66
|
+
if (f.name || f.line1 || f.line2 || f.line3 || f.visible !== undefined || f.hide !== undefined) {
|
|
67
|
+
const visible = f.hide ? false : (f.visible !== undefined ? f.visible === 'true' || f.visible === true : undefined);
|
|
67
68
|
const data = await setProfile({
|
|
68
69
|
device_id: f.id,
|
|
69
70
|
display_name: f.name,
|
|
@@ -71,6 +72,7 @@ export async function handleProfile(f) {
|
|
|
71
72
|
line1: f.line1,
|
|
72
73
|
line2: f.line2,
|
|
73
74
|
line3: f.line3,
|
|
75
|
+
...(visible !== undefined && { visible }),
|
|
74
76
|
});
|
|
75
77
|
console.log("✅ Profile saved");
|
|
76
78
|
console.log(JSON.stringify(data, null, 2));
|
|
@@ -85,10 +87,11 @@ export async function handleProfile(f) {
|
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
export async function handleAccept(f) {
|
|
88
|
-
if (!f.id || !f.target) return console.error("Usage: antenna accept --id telegram:123 --target telegram:789 [--contact 'WeChat: yi']");
|
|
90
|
+
if (!f.id || (!f.target && !f.ref)) return console.error("Usage: antenna accept --id telegram:123 --ref 1 [--contact 'WeChat: yi']\n antenna accept --id telegram:123 --target telegram:789 [--contact 'WeChat: yi']");
|
|
89
91
|
const result = await accept({
|
|
90
92
|
device_id: f.id,
|
|
91
|
-
target_device_id: f.target,
|
|
93
|
+
target_device_id: f.target || null,
|
|
94
|
+
ref: f.ref || null,
|
|
92
95
|
contact_info: f.contact,
|
|
93
96
|
});
|
|
94
97
|
console.log("✅ " + result.message);
|