mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +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) {
|
||||
List<Manager> managers;
|
||||
if (m != null) {
|
||||
managers = List.of(m);
|
||||
} else {
|
||||
return List.of(m);
|
||||
}
|
||||
if (c != null) {
|
||||
final var account = query.get("account");
|
||||
if (account == null || account.isEmpty()) {
|
||||
managers = c.getManagers();
|
||||
return c.getManagers();
|
||||
} else {
|
||||
final var manager = c.getManager(account);
|
||||
if (manager == null) {
|
||||
return null;
|
||||
}
|
||||
managers = List.of(manager);
|
||||
return List.of(manager);
|
||||
}
|
||||
}
|
||||
return managers;
|
||||
return List.of();
|
||||
}
|
||||
|
||||
private List<Pair<Manager, Manager.ReceiveMessageHandler>> subscribeReceiveHandlers(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue