mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-02 12:30:39 +00:00
some small dbus return code fixes
This commit is contained in:
parent
52739140ef
commit
dbd1d78efd
3 changed files with 6 additions and 3 deletions
|
@ -2365,9 +2365,9 @@ public class Manager implements Closeable {
|
|||
|
||||
final var profileEntry = account.getProfileStore().getProfileEntry(address);
|
||||
if (profileEntry != null && profileEntry.getProfile() != null) {
|
||||
return profileEntry.getProfile().getDisplayName();
|
||||
String name = profileEntry.getProfile().getDisplayName();
|
||||
return name==null?"":name;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -665,7 +665,7 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
|
|||
private String formatContact(SignalServiceAddress address) {
|
||||
final var number = address.getLegacyIdentifier();
|
||||
var name = m.getContactOrProfileName(number);
|
||||
if (name == null) {
|
||||
if (name == null || name.isEmpty()) {
|
||||
return number;
|
||||
} else {
|
||||
return MessageFormatter.arrayFormat("“{}” {}", new Object[]{name, number}).getMessage();
|
||||
|
|
|
@ -333,6 +333,9 @@ public class DbusSignalImpl implements Signal {
|
|||
public void joinGroup(final String groupLink) {
|
||||
try {
|
||||
final var linkUrl = GroupInviteLinkUrl.fromUri(groupLink);
|
||||
if (linkUrl == null) {
|
||||
throw new Error.Failure("Group link is invalid:");
|
||||
}
|
||||
m.joinGroup(linkUrl);
|
||||
} catch (GroupInviteLinkUrl.InvalidGroupLinkException | GroupLinkNotActiveException e) {
|
||||
throw new Error.Failure("Group link is invalid: " + e.getMessage());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue