mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-01-26 18:53:34 +00:00
Remove now unnecessary check for primary device from updateContact
Fixes #1880
This commit is contained in:
parent
f1de69d7ff
commit
eb52380ecf
@ -271,7 +271,7 @@ public interface Manager extends Closeable {
|
||||
final String nickGivenName,
|
||||
final String nickFamilyName,
|
||||
final String note
|
||||
) throws NotPrimaryDeviceException, UnregisteredRecipientException;
|
||||
) throws UnregisteredRecipientException;
|
||||
|
||||
void setContactsBlocked(
|
||||
Collection<RecipientIdentifier.Single> recipient,
|
||||
|
||||
@ -1138,10 +1138,7 @@ public class ManagerImpl implements Manager {
|
||||
final String nickGivenName,
|
||||
final String nickFamilyName,
|
||||
final String note
|
||||
) throws NotPrimaryDeviceException, UnregisteredRecipientException {
|
||||
if (!account.isPrimaryDevice()) {
|
||||
throw new NotPrimaryDeviceException();
|
||||
}
|
||||
) throws UnregisteredRecipientException {
|
||||
context.getContactHelper()
|
||||
.setContactName(context.getRecipientHelper().resolveRecipient(recipient),
|
||||
givenName,
|
||||
|
||||
@ -7,7 +7,6 @@ import org.asamk.signal.commands.exceptions.CommandException;
|
||||
import org.asamk.signal.commands.exceptions.IOErrorException;
|
||||
import org.asamk.signal.commands.exceptions.UserErrorException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.api.NotPrimaryDeviceException;
|
||||
import org.asamk.signal.manager.api.UnregisteredRecipientException;
|
||||
import org.asamk.signal.output.OutputWriter;
|
||||
import org.asamk.signal.util.CommandUtil;
|
||||
@ -63,8 +62,6 @@ public class UpdateContactCommand implements JsonRpcLocalCommand {
|
||||
m.setContactName(recipient, givenName, familyName, nickGivenName, nickFamilyName, note);
|
||||
} catch (IOException e) {
|
||||
throw new IOErrorException("Update contact error: " + e.getMessage(), e);
|
||||
} catch (NotPrimaryDeviceException e) {
|
||||
throw new UserErrorException("This command doesn't work on linked devices.");
|
||||
} catch (UnregisteredRecipientException e) {
|
||||
throw new UserErrorException("The user " + e.getSender().getIdentifier() + " is not registered.");
|
||||
}
|
||||
|
||||
@ -563,7 +563,7 @@ public class DbusManagerImpl implements Manager {
|
||||
final String nickGivenName,
|
||||
final String nickFamilyName,
|
||||
final String note
|
||||
) throws NotPrimaryDeviceException {
|
||||
) {
|
||||
signal.setContactName(recipient.getIdentifier(), givenName);
|
||||
}
|
||||
|
||||
|
||||
@ -537,8 +537,6 @@ public class DbusSignalImpl implements Signal, AutoCloseable {
|
||||
public void setContactName(final String number, final String name) {
|
||||
try {
|
||||
m.setContactName(getSingleRecipientIdentifier(number, m.getSelfNumber()), name, "", null, null, null);
|
||||
} catch (NotPrimaryDeviceException e) {
|
||||
throw new Error.Failure("This command doesn't work on linked devices.");
|
||||
} catch (UnregisteredRecipientException e) {
|
||||
throw new Error.UntrustedIdentity(e.getSender().getIdentifier() + " is not registered.");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user