return PhoneNumberFormatter.isValidNumber(e164Number, countryCode);
}
- static List<String> getAllLocalNumbers(File settingsPath) {
+ static List<String> getAllLocalAccountNumbers(File settingsPath) {
var pathConfig = PathConfig.createDefault(settingsPath);
final var dataPath = pathConfig.dataPath();
final var files = dataPath.listFiles();
GroupInviteLinkUrl inviteLinkUrl
) throws IOException, InactiveGroupLinkException;
- void sendTypingMessage(
+ SendMessageResults sendTypingMessage(
TypingAction action, Set<RecipientIdentifier> recipients
- ) throws IOException, UntrustedIdentityException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException;
+ ) throws IOException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException;
- void sendReadReceipt(
+ SendMessageResults sendReadReceipt(
RecipientIdentifier.Single sender, List<Long> messageIds
- ) throws IOException, UntrustedIdentityException;
+ ) throws IOException;
- void sendViewedReceipt(
+ SendMessageResults sendViewedReceipt(
RecipientIdentifier.Single sender, List<Long> messageIds
- ) throws IOException, UntrustedIdentityException;
+ ) throws IOException;
SendMessageResults sendMessage(
Message message, Set<RecipientIdentifier> recipients
* Add a handler to receive new messages.
* Will start receiving messages from server, if not already started.
*/
- void addReceiveHandler(ReceiveMessageHandler handler);
+ default void addReceiveHandler(ReceiveMessageHandler handler) {
+ addReceiveHandler(handler, false);
+ }
+
+ void addReceiveHandler(ReceiveMessageHandler handler, final boolean isWeakListener);
/**
* Remove a handler to receive new messages.
boolean trustIdentityAllKeys(RecipientIdentifier.Single recipient);
+ void addClosedListener(Runnable listener);
+
@Override
void close() throws IOException;
interface ReceiveMessageHandler {
+ ReceiveMessageHandler EMPTY = (envelope, e) -> {
+ };
+
void handleMessage(MessageEnvelope envelope, Throwable e);
}
}