mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Output "SharedContacts" field from a SignalDataMessage (#529)
* Initial version of SharedContacts from data message. Need to change location of avatar downloaded and fix plain text mode * Made empty strings for json null and fixed plaintext output * Removed old comments, simplified if-statement and added a 'leadingSpaces' field to the print attachments/mentions functions * Added AsamK's changes
This commit is contained in:
parent
9f3276d7e3
commit
237abe431b
10 changed files with 399 additions and 25 deletions
|
@ -2,12 +2,21 @@ package org.asamk.signal.util;
|
|||
|
||||
import org.asamk.signal.manager.groups.GroupId;
|
||||
import org.asamk.signal.manager.groups.GroupIdFormatException;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
|
||||
public class Util {
|
||||
|
||||
private Util() {
|
||||
}
|
||||
|
||||
public static String getStringIfNotBlank(Optional<String> value) {
|
||||
String string = value.orNull();
|
||||
if (string == null || string.isBlank()) {
|
||||
return null;
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
public static String formatSafetyNumber(String digits) {
|
||||
final int partCount = 12;
|
||||
int partSize = digits.length() / partCount;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue