import org.asamk.signal.util.Util;
import org.freedesktop.dbus.exceptions.DBusExecutionException;
import org.whispersystems.signalservice.api.push.exceptions.EncapsulatedExceptions;
+import org.whispersystems.signalservice.api.util.InvalidNumberException;
import java.io.IOException;
import java.nio.charset.Charset;
import static org.asamk.signal.util.ErrorUtils.handleGroupIdFormatException;
import static org.asamk.signal.util.ErrorUtils.handleGroupNotFoundException;
import static org.asamk.signal.util.ErrorUtils.handleIOException;
+import static org.asamk.signal.util.ErrorUtils.handleInvalidNumberException;
import static org.asamk.signal.util.ErrorUtils.handleNotAGroupMemberException;
public class SendCommand implements DbusCommand {
if (ns.getBoolean("endsession")) {
try {
- signal.sendEndSessionMessage(ns.<String>getList("recipient"));
+ signal.sendEndSessionMessage(ns.getList("recipient"));
return 0;
} catch (IOException e) {
handleIOException(e);
} catch (DBusExecutionException e) {
handleDBusExecutionException(e);
return 1;
+ } catch (InvalidNumberException e) {
+ handleInvalidNumberException(e);
+ return 1;
}
}
byte[] groupId = Util.decodeGroupId(ns.getString("group"));
signal.sendGroupMessage(messageText, attachments, groupId);
} else {
- signal.sendMessage(messageText, attachments, ns.<String>getList("recipient"));
+ signal.sendMessage(messageText, attachments, ns.getList("recipient"));
}
return 0;
} catch (IOException e) {
} catch (GroupIdFormatException e) {
handleGroupIdFormatException(e);
return 1;
+ } catch (InvalidNumberException e) {
+ handleInvalidNumberException(e);
+ return 1;
}
}
}