mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 11:00:38 +00:00
Remove dead code and fix inspection issues
This commit is contained in:
parent
6ffeb7c431
commit
e83f43065e
13 changed files with 10 additions and 82 deletions
|
@ -131,7 +131,7 @@ public class DbusManagerImpl implements Manager {
|
|||
emptyIfNull(about),
|
||||
emptyIfNull(aboutEmoji),
|
||||
avatar == null ? "" : avatar.map(File::getPath).orElse(""),
|
||||
avatar != null && !avatar.isPresent());
|
||||
avatar != null && avatar.isEmpty());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -786,9 +786,8 @@ public class DbusManagerImpl implements Manager {
|
|||
|
||||
private void notifyMessageHandlers(final MessageEnvelope envelope) {
|
||||
synchronized (messageHandlers) {
|
||||
Stream.concat(messageHandlers.stream(), weakHandlers.stream()).forEach(h -> {
|
||||
h.handleMessage(envelope, null);
|
||||
});
|
||||
Stream.concat(messageHandlers.stream(), weakHandlers.stream())
|
||||
.forEach(h -> h.handleMessage(envelope, null));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,12 +18,10 @@ import java.util.stream.Collectors;
|
|||
|
||||
public class DbusReceiveMessageHandler implements Manager.ReceiveMessageHandler {
|
||||
|
||||
private final Manager m;
|
||||
private final DBusConnection conn;
|
||||
private final String objectPath;
|
||||
|
||||
public DbusReceiveMessageHandler(Manager m, DBusConnection conn, final String objectPath) {
|
||||
this.m = m;
|
||||
public DbusReceiveMessageHandler(DBusConnection conn, final String objectPath) {
|
||||
this.conn = conn;
|
||||
this.objectPath = objectPath;
|
||||
}
|
||||
|
@ -127,7 +125,7 @@ public class DbusReceiveMessageHandler implements Manager.ReceiveMessageHandler
|
|||
var attachments = message.attachments()
|
||||
.stream()
|
||||
.filter(a -> a.id().isPresent())
|
||||
.map(a -> getAttachmentMap(m, a))
|
||||
.map(this::getAttachmentMap)
|
||||
.collect(Collectors.toList());
|
||||
extras.put("attachments", new Variant<>(attachments, "aa{sv}"));
|
||||
}
|
||||
|
@ -180,7 +178,7 @@ public class DbusReceiveMessageHandler implements Manager.ReceiveMessageHandler
|
|||
}
|
||||
|
||||
private Map<String, Variant<?>> getAttachmentMap(
|
||||
final Manager m, final MessageEnvelope.Data.Attachment a
|
||||
final MessageEnvelope.Data.Attachment a
|
||||
) {
|
||||
final var map = new HashMap<String, Variant<?>>();
|
||||
if (a.id().isPresent()) {
|
||||
|
|
|
@ -111,7 +111,7 @@ public class DbusSignalImpl implements Signal {
|
|||
@Override
|
||||
public void subscribeReceive() {
|
||||
if (dbusMessageHandler == null) {
|
||||
dbusMessageHandler = new DbusReceiveMessageHandler(m, connection, objectPath);
|
||||
dbusMessageHandler = new DbusReceiveMessageHandler(connection, objectPath);
|
||||
m.addReceiveHandler(dbusMessageHandler);
|
||||
}
|
||||
subscriberCount++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue