X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/1c4a32fef4a3273099f0bfdd1b0dea72d32324ae..c56a8df9b286eee786c7e81764c5394eced51295:/src/main/java/org/asamk/Signal.java diff --git a/src/main/java/org/asamk/Signal.java b/src/main/java/org/asamk/Signal.java index 3bfeb5bd..2f81c196 100644 --- a/src/main/java/org/asamk/Signal.java +++ b/src/main/java/org/asamk/Signal.java @@ -1,8 +1,15 @@ package org.asamk; +import org.asamk.signal.commands.exceptions.IOErrorException; + +import org.freedesktop.dbus.DBusPath; +import org.freedesktop.dbus.Struct; +import org.freedesktop.dbus.annotations.DBusProperty; +import org.freedesktop.dbus.annotations.Position; import org.freedesktop.dbus.exceptions.DBusException; import org.freedesktop.dbus.exceptions.DBusExecutionException; import org.freedesktop.dbus.interfaces.DBusInterface; +import org.freedesktop.dbus.interfaces.Properties; import org.freedesktop.dbus.messages.DBusSignal; import java.util.List; @@ -13,6 +20,8 @@ import java.util.List; */ public interface Signal extends DBusInterface { + String getSelfNumber(); + long sendMessage( String message, List attachments, String recipient ) throws Error.AttachmentInvalid, Error.Failure, Error.InvalidNumber, Error.UntrustedIdentity; @@ -26,7 +35,7 @@ public interface Signal extends DBusInterface { ) throws Error.Failure, Error.GroupNotFound, Error.UntrustedIdentity; void sendReadReceipt( - String recipient, List targetSentTimestamp + String recipient, List messageIds ) throws Error.Failure, Error.UntrustedIdentity; long sendRemoteDeleteMessage( @@ -95,11 +104,20 @@ public interface Signal extends DBusInterface { void addDevice(String uri) throws Error.InvalidUri; - void removeDevice(int deviceId) throws Error.Failure; + DBusPath getDevice(long deviceId); + + List listDevices() throws Error.Failure; - List listDevices() throws Error.Failure; + DBusPath getThisDevice(); - void updateDeviceName(String deviceName) throws Error.Failure; + void updateProfile( + String givenName, + String familyName, + String about, + String aboutEmoji, + String avatarPath, + boolean removeAvatar + ) throws Error.Failure; void updateProfile( String name, String about, String aboutEmoji, String avatarPath, boolean removeAvatar @@ -127,6 +145,8 @@ public interface Signal extends DBusInterface { String uploadStickerPack(String stickerPackPath) throws Error.Failure; + void submitRateLimitChallenge(String challenge, String captchaString) throws IOErrorException; + class MessageReceived extends DBusSignal { private final long timestamp; @@ -244,6 +264,45 @@ public interface Signal extends DBusInterface { } } + class StructDevice extends Struct { + + @Position(0) + DBusPath objectPath; + + @Position(1) + Long id; + + @Position(2) + String name; + + public StructDevice(final DBusPath objectPath, final Long id, final String name) { + this.objectPath = objectPath; + this.id = id; + this.name = name; + } + + public DBusPath getObjectPath() { + return objectPath; + } + + public Long getId() { + return id; + } + + public String getName() { + return name; + } + } + + @DBusProperty(name = "Id", type = Long.class, access = DBusProperty.Access.READ) + @DBusProperty(name = "Name", type = String.class) + @DBusProperty(name = "Created", type = String.class, access = DBusProperty.Access.READ) + @DBusProperty(name = "LastSeen", type = String.class, access = DBusProperty.Access.READ) + interface Device extends DBusInterface, Properties { + + void removeDevice() throws Error.Failure; + } + interface Error { class AttachmentInvalid extends DBusExecutionException {