mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Refactor UpdateContactCommand
This commit is contained in:
parent
53e7f83188
commit
faae998a7e
4 changed files with 20 additions and 12 deletions
|
@ -223,16 +223,24 @@ with every outgoing messages (excluding group messages).
|
||||||
*--remove-avatar*::
|
*--remove-avatar*::
|
||||||
Remove the avatar visible by message recipients.
|
Remove the avatar visible by message recipients.
|
||||||
|
|
||||||
setContactName
|
updateContact
|
||||||
--------------
|
--------------
|
||||||
Update name associated to a number on our contact list. This change is only local but can be synchronized to other devices by using `sendContacts` (see below).
|
Update the info associated to a number on our contact list. This change is only
|
||||||
number::
|
local but can be synchronized to other devices by using `sendContacts` (see
|
||||||
|
below).
|
||||||
|
If the contact doesn't exist yet, it will be added.
|
||||||
|
|
||||||
|
NUMBER::
|
||||||
Specify the contact phone number.
|
Specify the contact phone number.
|
||||||
name::
|
|
||||||
|
*-n*, *--name*::
|
||||||
Specify the new name for this contact.
|
Specify the new name for this contact.
|
||||||
|
|
||||||
sendContacts
|
sendContacts
|
||||||
------------
|
------------
|
||||||
Update contact list on Signal servers.
|
Send a synchronization message with the local contacts list to all linked devices.
|
||||||
|
This command should only be used if this is the master device.
|
||||||
|
|
||||||
daemon
|
daemon
|
||||||
~~~~~~
|
~~~~~~
|
||||||
signal-cli can run in daemon mode and provides an experimental dbus interface. For
|
signal-cli can run in daemon mode and provides an experimental dbus interface. For
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class Commands {
|
||||||
addCommand("removePin", new RemovePinCommand());
|
addCommand("removePin", new RemovePinCommand());
|
||||||
addCommand("send", new SendCommand());
|
addCommand("send", new SendCommand());
|
||||||
addCommand("sendContacts", new SendContactsCommand());
|
addCommand("sendContacts", new SendContactsCommand());
|
||||||
addCommand("setContactName", new SetContactNameCommand());
|
addCommand("updateContact", new UpdateContactCommand());
|
||||||
addCommand("setPin", new SetPinCommand());
|
addCommand("setPin", new SetPinCommand());
|
||||||
addCommand("trust", new TrustCommand());
|
addCommand("trust", new TrustCommand());
|
||||||
addCommand("unregister", new UnregisterCommand());
|
addCommand("unregister", new UnregisterCommand());
|
||||||
|
|
|
@ -11,7 +11,7 @@ public class SendContactsCommand implements LocalCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attachToSubparser(final Subparser subparser) {
|
public void attachToSubparser(final Subparser subparser) {
|
||||||
subparser.help("Send contacts to the signal server.");
|
subparser.help("Send a synchronization message with the local contacts list to all linked devices.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,19 +1,20 @@
|
||||||
package org.asamk.signal.commands;
|
package org.asamk.signal.commands;
|
||||||
|
|
||||||
import net.sourceforge.argparse4j.impl.Arguments;
|
|
||||||
import net.sourceforge.argparse4j.inf.Namespace;
|
import net.sourceforge.argparse4j.inf.Namespace;
|
||||||
import net.sourceforge.argparse4j.inf.Subparser;
|
import net.sourceforge.argparse4j.inf.Subparser;
|
||||||
|
|
||||||
import org.asamk.signal.manager.Manager;
|
import org.asamk.signal.manager.Manager;
|
||||||
|
|
||||||
public class SetContactNameCommand implements LocalCommand {
|
public class UpdateContactCommand implements LocalCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attachToSubparser(final Subparser subparser) {
|
public void attachToSubparser(final Subparser subparser) {
|
||||||
subparser.addArgument("number")
|
subparser.addArgument("number")
|
||||||
.help("Contact number");
|
.help("Contact number");
|
||||||
subparser.addArgument("name")
|
subparser.addArgument("-n", "--name")
|
||||||
|
.required(true)
|
||||||
.help("New contact name");
|
.help("New contact name");
|
||||||
subparser.help("Set the name of a given contact");
|
subparser.help("Update the details of a given contact");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -30,5 +31,4 @@ public class SetContactNameCommand implements LocalCommand {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue