Signal
An asynchronous signald client, for use with V1 of the signald protocol. Use the create function to create an instance.
A synchronous signald client, for use with V1 of the signald protocol. Note that the functions and the constructor can block the thread that called the function / constructor due to reads and writes responses from a UNIX socket via blocking method calls.
Parameters
Throws
if unable to connect to the socket
if unable to get list of accounts to cache current account data if already registered.
if unable to connect to the socket
if unable to get list of accounts to cache current account data if already registered.
Constructors
Types
Functions
Accept a group V2 invitation. Note that you must have a profile name set to join groups.
Accept a group V2 invitation. Note that you must have a profile name set to join groups.
Creates a new group and returns the information of the newly created group.
Creates a new group and returns the information of the newly created group.
Deletes all account data signald has on disk, and optionally delete the account from the server as well. Note that this is not "unlink" and will delete the entire account, even from a linked device.
Deletes all account data signald has on disk, and optionally delete the account from the server as well. Note that this is not "unlink" and will delete the entire account, even from a linked device.
After a linking URI has been requested, finish_link must be called with the session_id provided with the URI.
After a linking URI has been requested, finish_link must be called with the session_id provided with the URI.
Generate a linking URI. Typically, this is QR encoded and scanned by the primary device. Submit the returned LinkingURI.sessionId with a finishLink request.
Generate a linking URI. Typically, this is QR encoded and scanned by the primary device. Submit the returned LinkingURI.sessionId with a finishLink request.
Returns all known identity keys for the current account
Returns all known identity keys for the current account
Query the server for the latest state of a known group. If no account in signald is a member of the group (anymore), a RequestFailedException with RequestFailedException.errorType: 'UnknownGroupException' is returned.
Query the server for the latest state of a known group. If no account in signald is a member of the group (anymore), a RequestFailedException with RequestFailedException.errorType: 'UnknownGroupException' is returned.
Query the server for group revision history. The history contains information about the changes between each revision and the user that made the change.
Query the server for group revision history. The history contains information about the changes between each revision and the user that made the change.
Gets a list of all linked devices for this account.
Gets a list of all linked devices for this account.
Gets all information available about a user
Gets all information available about a user
Gets a list of all signald servers
Gets a list of all signald servers
Takes a UUID of an identifier to check if it is registered on Signal. This UUID is either a Phone Number Identity (PNI) or an Account Identity (ACI).
Takes a UUID of an identifier to check if it is registered on Signal. This UUID is either a Phone Number Identity (PNI) or an Account Identity (ACI).
Leaves a group with the specified groupID.
Leaves a group with the specified groupID
Returns a list of contacts for this account.
Returns a list of contacts for this account.
Returns a list of groups for this account.
Returns a list of groups for this account.
Marks the given messages (represented as timestamps) as read. Note that messages are identified using their timestamps.
Marks the given messages (represented as timestamps) as read. Note that messages are identified using their timestamps.
Reacts to a previous message.
Reacts to a previous message.
Deny requests from users from joining a group.
Deny requests from users from joining a group.
Begin the account registration process by requesting a phone number verification code. When the code is received, submit it with a verify request.
Gets the remote config (feature flags) from the server.
Gets the remote config (feature flags) from the server
Sends a remote delete message to delete a message that was previously sent to the given recipient (group or individual address).
Sends a remote delete message to delete a message that was previously sent to the given recipient (group or individual address).
Remove a linked device from the Signal account. Only allowed when the local device id is 1
Remove a linked device from the Signal account. Only allowed when the local device id is 1
Request other devices on the account send us their group list, syncable config, contact list, and block list.
Request other devices on the account send us their group list, syncable config, contact list, and block list.
Resets a secure session with a particular user identified by the given address.
Resets a secure session with a particular user identified by the given address.
Resolve a partial JsonAddress with only a number or UUID to one with both. Anywhere that signald accepts a JsonAddress will accept a partial; this is a convenience function for client authors, mostly because signald doesn't resolve all the partials it returns.
Resolve a partial JsonAddress with only a number or UUID to one with both. Anywhere that signald accepts a JsonAddress will accept a partial; this is a convenience function for client authors, mostly because signald doesn't resolve all the partials it returns.
Sends a message to either a single user (Recipient.Individual) or a group (Recipient.Group).
Sends a message to either a single user (Recipient.Individual) or a group (Recipient.Group).
Sends a MobileCoin payment to the user identified by the recipientAddress.
Sends a MobileCoin payment to the user identified by the recipientAddress.
Sends a sync message to the account's devices.
Sends a sync message to the account's devices.
Set this device's name. This will show up on the mobile device on the same account under linked devices
Set this device's name. This will show up on the mobile device on the same account under linked devices
Set the message expiration timer for a thread.
Set the message expiration timer for a thread.
Sets the profile of the current account. Note that all the parameters here will be used as the new profile fields; leaving one of the fields unset or null means it will be treated as clearing it.
Sets the profile of the current account. Note that all the parameters here will be used as the new profile fields; leaving one of the fields unset or null means it will be treated as clearing it.
Submits a challenge that is requested by the server. Sometimes, when sending a message, the server may rate limit the sender (signald has ProofRequiredError
), requiring the user to either submit a push challenge (on Android, this is via Firebase Cloud Message) or a reCAPTCHA. This is indicated by the property org.inthewaves.kotlinsignald.clientprotocol.v1.structures.JsonSendMessageResult.proofRequiredFailure, which corresponds to ProofRequiredException
in the Signal-Android code.
Submits a challenge that is requested by the server. Sometimes, when sending a message, the server may rate limit the sender (signald has ProofRequiredError
), requiring the user to either submit a push challenge (on Android, this is via Firebase Cloud Message) or a reCAPTCHA. This is indicated by the property org.inthewaves.kotlinsignald.clientprotocol.v1.structures.JsonSendMessageResult.proofRequiredFailure, which corresponds to ProofRequiredException
in the Signal-Android code.
Function not supported on JS, as this is a blocking call. Use subscribeSuspend instead.
Receive incoming messages by creating a new, dedicated socket connection. After making a subscribe request, incoming messages will be sent to the client encoded as ClientMessageWrapper. When finished, to prevent leaks, send an unsubscribe request via Subscription.unsubscribe or disconnect from the socket via PersistentSocketWrapper.close to stop receiving messages.
Subscribes to incoming messages and consumes them on the thread that called this function. This will open a dedicated, persistent socket connection for this function call. The current thread will be blocked when it waits for more messages. After this function executes, an unsubscribe request will be made and the persistent socket will be closed.
Receive incoming messages by creating a new, dedicated socket connection. After making a subscribe request, incoming messages will be sent to the client encoded as ClientMessageWrapper. Send an unsubscribe request via Subscription.unsubscribe or disconnect from the socket via NodePersistentSocketWrapper.close to stop receiving messages.
Trust another user's safety number using either the QR code data or the safety number text
Trust another user's safety number using either the QR code data or the safety number text
Update information about a local contact. Null properties will be left alone.
Update information about a local contact. Null properties will be left alone.
Update information about a group
Update information about a group
Verify an account's phone number with a code after registering, completing the account creation process.
Gets the version of signald
Gets the version of signald
An optional part of the linking process. Intended to be called after displaying the QR code, will return quickly after the user scans the QR code. finishLink must be called after waitForScan returns a non-error.
An optional part of the linking process. Intended to be called after displaying the QR code, will return quickly after the user scans the QR code. finishLink must be called after waitForScan returns a non-error.
Properties
The account info for the specified accountId. May be null if the account doesn't exist with signald. If this is null, getting the account info will attempt a request to the signald socket.