1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +01:00

Remove getConfiguration() from XMPPConnection

interface definition.
This commit is contained in:
Júlio Cesar Bueno Cotta 2014-06-04 22:27:16 -03:00 committed by Florian Schmaus
parent 445d175a2e
commit 944ac37fc3
3 changed files with 28 additions and 11 deletions

View file

@ -240,8 +240,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
config = configuration;
}
@Override
public ConnectionConfiguration getConfiguration() {
protected ConnectionConfiguration getConfiguration() {
return config;
}
@ -1089,4 +1088,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
super.finalize();
}
}
@Override
public RosterStore getRosterStore() {
return config.getRosterStore();
}
@Override
public boolean isRosterLoadedAtLogin() {
return config.isRosterLoadedAtLogin();
}
}

View file

@ -122,7 +122,7 @@ public class Roster {
*/
Roster(final XMPPConnection connection) {
this.connection = connection;
rosterStore = connection.getConfiguration().getRosterStore();
rosterStore = connection.getRosterStore();
// Listen for any roster packets.
connection.addPacketListener(new RosterPushListener(), ROSTER_PUSH_FILTER);
// Listen for any presence packets.
@ -168,7 +168,7 @@ public class Roster {
// again if it's an anonymous connection.
if (connection.isAnonymous())
return;
if (!connection.getConfiguration().isRosterLoadedAtLogin())
if (!connection.isRosterLoadedAtLogin())
return;
try {
Roster.this.reload();

View file

@ -141,13 +141,6 @@ public interface XMPPConnection {
*/
public boolean isUsingCompression();
/**
* Returns the configuration used to connect to the server.
*
* @return the configuration used to connect to the server.
*/
public ConnectionConfiguration getConfiguration();
/**
* Sends the specified packet to the server.
*
@ -349,4 +342,19 @@ public interface XMPPConnection {
* @return the currently active {@link FromMode}
*/
public FromMode getFromMode();
/**
* Get the permanent roster store.
* @return the permanent roster store or null
*/
public RosterStore getRosterStore();
/**
* Returns true if the roster will be loaded from the server when logging in. This
* is the common behaviour for clients but sometimes clients may want to differ this
* or just never do it if not interested in rosters.
*
* @return true if the roster will be loaded from the server when logging in.
*/
public boolean isRosterLoadedAtLogin();
}