implement Dbus sync methods (#737)

implement two Dbus methods:
- sendContacts
- sendSyncRequest

update documentation
This commit is contained in:
John Freed 2021-09-26 09:00:26 +02:00 committed by GitHub
parent 1ca0e75ef1
commit 8bee08fd96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 0 deletions

View file

@ -107,6 +107,18 @@ sendGroupMessage(message<s>, attachments<as>, groupId<ay>) -> timestamp<x>::
Exceptions: GroupNotFound, Failure, AttachmentInvalid Exceptions: GroupNotFound, Failure, AttachmentInvalid
sendContacts() -> <>::
Sends a synchronization message with the local contacts list to all linked devices. This command should only be used if this is the primary device.
Exceptions: Failure
sendSyncRequest() -> <>::
Sends a synchronization request to the primary device (for group, contacts, ...). Only works if sent from a secondary device.
Exception: Failure
sendNoteToSelfMessage(message<s>, attachments<as>) -> timestamp<x>:: sendNoteToSelfMessage(message<s>, attachments<as>) -> timestamp<x>::
* message : Text to send (can be UTF8) * message : Text to send (can be UTF8)
* attachments : String array of filenames to send as attachments (passed as filename, so need to be readable by the user signal-cli is running under) * attachments : String array of filenames to send as attachments (passed as filename, so need to be readable by the user signal-cli is running under)

View file

@ -49,6 +49,10 @@ public interface Signal extends DBusInterface {
String emoji, boolean remove, String targetAuthor, long targetSentTimestamp, List<String> recipients String emoji, boolean remove, String targetAuthor, long targetSentTimestamp, List<String> recipients
) throws Error.InvalidNumber, Error.Failure; ) throws Error.InvalidNumber, Error.Failure;
void sendContacts() throws Error.Failure;
void sendSyncRequest() throws Error.Failure;
long sendNoteToSelfMessage( long sendNoteToSelfMessage(
String message, List<String> attachments String message, List<String> attachments
) throws Error.AttachmentInvalid, Error.Failure; ) throws Error.AttachmentInvalid, Error.Failure;

View file

@ -202,6 +202,24 @@ public class DbusSignalImpl implements Signal {
} }
} }
@Override
public void sendContacts() {
try {
m.sendContacts();
} catch (IOException e) {
throw new Error.Failure("SendContacts error: " + e.getMessage());
}
}
@Override
public void sendSyncRequest() {
try {
m.requestAllSyncData();
} catch (IOException e) {
throw new Error.Failure("Request sync data error: " + e.getMessage());
}
}
@Override @Override
public long sendNoteToSelfMessage( public long sendNoteToSelfMessage(
final String message, final List<String> attachments final String message, final List<String> attachments