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:
Atomic-Bean 2021-02-20 03:33:15 +10:30 committed by GitHub
parent 9f3276d7e3
commit 237abe431b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 399 additions and 25 deletions

View file

@ -0,0 +1,24 @@
package org.asamk.signal.json;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.asamk.signal.util.Util;
import org.whispersystems.signalservice.api.messages.shared.SharedContact;
public class JsonContactPhone {
@JsonProperty
private final String value;
@JsonProperty
private final SharedContact.Phone.Type type;
@JsonProperty
private final String label;
public JsonContactPhone(SharedContact.Phone phone) {
value = phone.getValue();
type = phone.getType();
label = Util.getStringIfNotBlank(phone.getLabel());
}
}