1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +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; config = configuration;
} }
@Override protected ConnectionConfiguration getConfiguration() {
public ConnectionConfiguration getConfiguration() {
return config; return config;
} }
@ -1089,4 +1088,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
super.finalize(); 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) { Roster(final XMPPConnection connection) {
this.connection = connection; this.connection = connection;
rosterStore = connection.getConfiguration().getRosterStore(); rosterStore = connection.getRosterStore();
// Listen for any roster packets. // Listen for any roster packets.
connection.addPacketListener(new RosterPushListener(), ROSTER_PUSH_FILTER); connection.addPacketListener(new RosterPushListener(), ROSTER_PUSH_FILTER);
// Listen for any presence packets. // Listen for any presence packets.
@ -168,7 +168,7 @@ public class Roster {
// again if it's an anonymous connection. // again if it's an anonymous connection.
if (connection.isAnonymous()) if (connection.isAnonymous())
return; return;
if (!connection.getConfiguration().isRosterLoadedAtLogin()) if (!connection.isRosterLoadedAtLogin())
return; return;
try { try {
Roster.this.reload(); Roster.this.reload();

View file

@ -141,13 +141,6 @@ public interface XMPPConnection {
*/ */
public boolean isUsingCompression(); 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. * Sends the specified packet to the server.
* *
@ -349,4 +342,19 @@ public interface XMPPConnection {
* @return the currently active {@link FromMode} * @return the currently active {@link FromMode}
*/ */
public FromMode getFromMode(); 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();
} }