mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Handle mentions when receiving from dbus
This commit is contained in:
parent
ac2343b142
commit
ca1a852b44
2 changed files with 21 additions and 6 deletions
|
@ -849,7 +849,7 @@ public class DbusManagerImpl implements Manager {
|
|||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
List.of(),
|
||||
List.of(),
|
||||
getMentions(extras),
|
||||
List.of(),
|
||||
List.of())),
|
||||
Optional.empty(),
|
||||
|
@ -893,7 +893,7 @@ public class DbusManagerImpl implements Manager {
|
|||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
List.of(),
|
||||
List.of(),
|
||||
getMentions(extras),
|
||||
List.of(),
|
||||
List.of()))),
|
||||
Optional.empty(),
|
||||
|
@ -970,7 +970,7 @@ public class DbusManagerImpl implements Manager {
|
|||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
List.of(),
|
||||
List.of(),
|
||||
getMentions(extras),
|
||||
List.of(),
|
||||
List.of())),
|
||||
Optional.empty(),
|
||||
|
@ -1039,6 +1039,19 @@ public class DbusManagerImpl implements Manager {
|
|||
}).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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue