some small dbus return code fixes (#556)
* some small dbus return code fixes * Added DBus manpage * changed getDisplayName behaviour * reverted change in manager
This commit is contained in:
parent
2ea56a1b67
commit
a7b414a870
@ -2367,7 +2367,6 @@ public class Manager implements Closeable {
|
|||||||
if (profileEntry != null && profileEntry.getProfile() != null) {
|
if (profileEntry != null && profileEntry.getProfile() != null) {
|
||||||
return profileEntry.getProfile().getDisplayName();
|
return profileEntry.getProfile().getDisplayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ public class SignalProfile {
|
|||||||
|
|
||||||
public String getDisplayName() {
|
public String getDisplayName() {
|
||||||
// First name and last name (if set) are separated by a NULL char + trim space in case only one is filled
|
// First name and last name (if set) are separated by a NULL char + trim space in case only one is filled
|
||||||
return name == null ? null : name.replace("\0", " ").trim();
|
return name == null ? "" : name.replace("\0", " ").trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAbout() {
|
public String getAbout() {
|
||||||
|
@ -665,7 +665,7 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
|
|||||||
private String formatContact(SignalServiceAddress address) {
|
private String formatContact(SignalServiceAddress address) {
|
||||||
final var number = address.getLegacyIdentifier();
|
final var number = address.getLegacyIdentifier();
|
||||||
var name = m.getContactOrProfileName(number);
|
var name = m.getContactOrProfileName(number);
|
||||||
if (name == null) {
|
if (name == null || name.isEmpty()) {
|
||||||
return number;
|
return number;
|
||||||
} else {
|
} else {
|
||||||
return MessageFormatter.arrayFormat("“{}” {}", new Object[]{name, number}).getMessage();
|
return MessageFormatter.arrayFormat("“{}” {}", new Object[]{name, number}).getMessage();
|
||||||
|
@ -333,6 +333,9 @@ public class DbusSignalImpl implements Signal {
|
|||||||
public void joinGroup(final String groupLink) {
|
public void joinGroup(final String groupLink) {
|
||||||
try {
|
try {
|
||||||
final var linkUrl = GroupInviteLinkUrl.fromUri(groupLink);
|
final var linkUrl = GroupInviteLinkUrl.fromUri(groupLink);
|
||||||
|
if (linkUrl == null) {
|
||||||
|
throw new Error.Failure("Group link is invalid:");
|
||||||
|
}
|
||||||
m.joinGroup(linkUrl);
|
m.joinGroup(linkUrl);
|
||||||
} catch (GroupInviteLinkUrl.InvalidGroupLinkException | GroupLinkNotActiveException e) {
|
} catch (GroupInviteLinkUrl.InvalidGroupLinkException | GroupLinkNotActiveException e) {
|
||||||
throw new Error.Failure("Group link is invalid: " + e.getMessage());
|
throw new Error.Failure("Group link is invalid: " + e.getMessage());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user