mirror of
https://github.com/aljazceru/signal-cli.git
synced 2026-01-17 12:44:25 +01:00
18 lines
582 B
Java
18 lines
582 B
Java
package org.asamk.signal.json;
|
|
|
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
|
|
|
import java.util.UUID;
|
|
|
|
public record JsonMention(@Deprecated String name, String number, String uuid, int start, int length) {
|
|
|
|
static JsonMention from(MessageEnvelope.Data.Mention mention) {
|
|
final var address = mention.recipient();
|
|
return new JsonMention(address.getLegacyIdentifier(),
|
|
address.number().orElse(null),
|
|
address.uuid().map(UUID::toString).orElse(null),
|
|
mention.start(),
|
|
mention.length());
|
|
}
|
|
}
|