X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/d72b838560b1a4186ac121c7d605773b49fcdf46..8416d4a:/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 2105ca76..cf909fa0 100644 --- a/src/main/java/org/asamk/Signal.java +++ b/src/main/java/org/asamk/Signal.java @@ -1,8 +1,11 @@ package org.asamk; +import org.freedesktop.dbus.DBusPath; +import org.freedesktop.dbus.annotations.DBusProperty; 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,7 +16,7 @@ import java.util.List; */ public interface Signal extends DBusInterface { - String getNumber(); + String getSelfNumber(); long sendMessage( String message, List attachments, String recipient @@ -97,11 +100,11 @@ 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; - void updateDeviceName(String deviceName) throws Error.Failure; + DBusPath getThisDevice(); void updateProfile( String givenName, @@ -138,6 +141,10 @@ public interface Signal extends DBusInterface { String uploadStickerPack(String stickerPackPath) throws Error.Failure; + void setConfiguration(boolean readReceipts, boolean unidentifiedDeliveryIndicators, boolean typingIndicators, boolean linkPreviews) throws Error.IOError, Error.UserError; + + List getConfiguration(); + class MessageReceived extends DBusSignal { private final long timestamp; @@ -255,6 +262,15 @@ public interface Signal extends DBusInterface { } } + @DBusProperty(name = "Id", type = Integer.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 { @@ -305,5 +321,19 @@ public interface Signal extends DBusInterface { super(message); } } + + class IOError extends DBusExecutionException { + + public IOError(final String message) { + super(message); + } + } + + class UserError extends DBusExecutionException { + + public UserError(final String message) { + super(message); + } + } } }