mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-31 11:30:39 +00:00
17 lines
582 B
Java
17 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());
|
|
}
|
|
}
|