mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Refactor getManagerFromQuery method
This commit is contained in:
parent
3027ba2cf1
commit
6b04197eaa
1 changed files with 6 additions and 6 deletions
|
@ -201,22 +201,22 @@ public class HttpServerHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Manager> getManagerFromQuery(final Map<String, String> query) {
|
private List<Manager> getManagerFromQuery(final Map<String, String> query) {
|
||||||
List<Manager> managers;
|
|
||||||
if (m != null) {
|
if (m != null) {
|
||||||
managers = List.of(m);
|
return List.of(m);
|
||||||
} else {
|
}
|
||||||
|
if (c != null) {
|
||||||
final var account = query.get("account");
|
final var account = query.get("account");
|
||||||
if (account == null || account.isEmpty()) {
|
if (account == null || account.isEmpty()) {
|
||||||
managers = c.getManagers();
|
return c.getManagers();
|
||||||
} else {
|
} else {
|
||||||
final var manager = c.getManager(account);
|
final var manager = c.getManager(account);
|
||||||
if (manager == null) {
|
if (manager == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
managers = List.of(manager);
|
return List.of(manager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return managers;
|
return List.of();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Pair<Manager, Manager.ReceiveMessageHandler>> subscribeReceiveHandlers(
|
private List<Pair<Manager, Manager.ReceiveMessageHandler>> subscribeReceiveHandlers(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue