mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-01 20:10:39 +00:00
Merge c9454267d9
into 8e8de2fe39
This commit is contained in:
commit
8192464b4d
2 changed files with 19 additions and 0 deletions
|
@ -19,6 +19,10 @@ public interface Signal extends DBusInterface {
|
|||
|
||||
void sendGroupMessage(String message, List<String> attachments, byte[] groupId) throws EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, IOException;
|
||||
|
||||
String getContactName(String number);
|
||||
|
||||
String getGroupName(byte[] groupId);
|
||||
|
||||
class MessageReceived extends DBusSignal {
|
||||
private long timestamp;
|
||||
private String sender;
|
||||
|
|
|
@ -775,6 +775,21 @@ class Manager implements Signal {
|
|||
sendMessage(messageBuilder, recipients);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContactName(String number) {
|
||||
ContactInfo contact = contactStore.getContact(number);
|
||||
if(contact == null) {
|
||||
return number;
|
||||
} else {
|
||||
return contact.name;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupName(byte[] groupId) {
|
||||
return getGroup(groupId).name;
|
||||
}
|
||||
|
||||
private void requestSyncGroups() throws IOException {
|
||||
SignalServiceProtos.SyncMessage.Request r = SignalServiceProtos.SyncMessage.Request.newBuilder().setType(SignalServiceProtos.SyncMessage.Request.Type.GROUPS).build();
|
||||
SignalServiceSyncMessage message = SignalServiceSyncMessage.forRequest(new RequestMessage(r));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue