import org.asamk.signal.manager.api.UpdateGroup;
import org.asamk.signal.manager.api.UpdateProfile;
import org.asamk.signal.manager.api.UserStatus;
+import org.asamk.signal.manager.api.UsernameLinkUrl;
import org.freedesktop.dbus.DBusMap;
import org.freedesktop.dbus.DBusPath;
import org.freedesktop.dbus.connections.impl.DBusConnection;
}
@Override
- public void updateAccountAttributes(final String deviceName) throws IOException {
+ public void updateAccountAttributes(
+ final String deviceName, final Boolean unrestrictedUnidentifiedSender
+ ) throws IOException {
if (deviceName != null) {
final var devicePath = signal.getThisDevice();
getRemoteObject(devicePath, Signal.Device.class).Set("org.asamk.Signal.Device", "Name", deviceName);
}
@Override
- public String setUsername(final String username) throws IOException, InvalidUsernameException {
+ public String getUsername() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public UsernameLinkUrl getUsernameLink() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setUsername(final String username) throws IOException, InvalidUsernameException {
throw new UnsupportedOperationException();
}
@Override
public SendMessageResults sendMessage(
- final Message message, final Set<RecipientIdentifier> recipients
+ final Message message, final Set<RecipientIdentifier> recipients, final boolean notifySelf
) throws IOException, AttachmentInvalidException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException {
return handleMessage(recipients,
numbers -> signal.sendMessage(message.messageText(), message.attachments(), numbers),
Optional.empty(),
Optional.empty(),
List.of(),
- List.of(),
+ getMentions(extras),
List.of(),
List.of())),
Optional.empty(),
Optional.empty(),
Optional.empty(),
List.of(),
- List.of(),
+ getMentions(extras),
List.of(),
List.of()))),
Optional.empty(),
Optional.empty(),
Optional.empty(),
List.of(),
- List.of(),
+ getMentions(extras),
List.of(),
List.of())),
Optional.empty(),
}).toList();
}
+ private List<MessageEnvelope.Data.Mention> getMentions(final Map<String, Variant<?>> extras) {
+ if (!extras.containsKey("mentions")) {
+ return List.of();
+ }
+
+ final List<DBusMap<String, Variant<?>>> mentions = getValue(extras, "mentions");
+ return mentions.stream()
+ .map(a -> new MessageEnvelope.Data.Mention(new RecipientAddress(null, getValue(a, "recipient")),
+ getValue(a, "start"),
+ getValue(a, "length")))
+ .toList();
+ }
+
@Override
public InputStream retrieveAttachment(final String id) throws IOException {
throw new UnsupportedOperationException();