mirror of
https://codeberg.org/Mercury-IM/Mercury-IM
synced 2024-09-27 18:29:34 +02:00
Move initialization code to method
This commit is contained in:
parent
b07d6d541b
commit
3744778155
|
@ -102,12 +102,7 @@ public class ConnectionCenter {
|
|||
connectionMap.put(account.getId(), connection);
|
||||
|
||||
// initialize new connection
|
||||
RosterStore rosterStore = new RosterStore(rosterRepository);
|
||||
rosterStore.setAccountId(account.getId());
|
||||
rosterStore.subscribe();
|
||||
connection.getRoster().setRosterStore(rosterStore);
|
||||
|
||||
messageStore.registerForMercuryConnection(connection);
|
||||
initializeConnection(connection);
|
||||
|
||||
if (account.getEnabled()) {
|
||||
LOGGER.log(Level.INFO, "Connecting...");
|
||||
|
@ -168,6 +163,19 @@ public class ConnectionCenter {
|
|||
return new MercuryConnection(tcpConnection, accountModel.getId());
|
||||
}
|
||||
|
||||
public void initializeConnection(MercuryConnection connection) {
|
||||
// Register roster store
|
||||
RosterStore rosterStore = new RosterStore(rosterRepository);
|
||||
rosterStore.setAccountId(connection.getAccountId());
|
||||
rosterStore.subscribe();
|
||||
connection.getRoster().setRosterStore(rosterStore);
|
||||
|
||||
// Register message store
|
||||
messageStore.registerForMercuryConnection(connection);
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Client State Indication status to active.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue