mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-10-29 19:57:28 +00:00
Replace usage of deprecated method with alternative and remove method itself.
Deprecated method: ``` org.jivesoftware.spark.SessionManager.getBareAddress ``` Alternative method: ``` org.jivesoftware.spark.SessionManager.getUserBareAddress ``` Alternative method renamed from getBareUserAddress() to getUserBareAddress().
This commit is contained in:
parent
f450301048
commit
52f4d7ab05
@ -146,11 +146,11 @@ public class PresenceManager {
|
||||
/**
|
||||
* Returns the presence of a user.
|
||||
*
|
||||
* @param jidString the users jid.
|
||||
* @param jid the users JID.
|
||||
* @return the users presence.
|
||||
*/
|
||||
public static Presence getPresence(BareJid jid) {
|
||||
if (jid.equals(SparkManager.getSessionManager().getBareAddress())) {
|
||||
if (jid.equals(SparkManager.getSessionManager().getUserBareAddress())) {
|
||||
return SparkManager.getWorkspace().getStatusBar().getPresence();
|
||||
} else {
|
||||
final Roster roster = Roster.getInstanceFor( SparkManager.getConnection() );
|
||||
|
||||
@ -28,7 +28,6 @@ import org.jivesoftware.sparkimpl.plugin.manager.Features;
|
||||
import org.jxmpp.jid.DomainBareJid;
|
||||
import org.jxmpp.jid.EntityBareJid;
|
||||
import org.jxmpp.jid.EntityFullJid;
|
||||
import org.jxmpp.jid.impl.JidCreate;
|
||||
import org.jxmpp.util.XmppStringUtils;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
@ -260,24 +259,12 @@ public final class SessionManager implements ConnectionListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the users bare address. A bare-address is the address without a resource (ex. derek@jivesoftware.com/spark would
|
||||
* Returns the users bare JID. A bare-JID is the JID without a resource (ex. derek@jivesoftware.com/spark would
|
||||
* be derek@jivesoftware.com)
|
||||
*
|
||||
* @return the users bare address.
|
||||
* @deprecated use {@link #getBareUserAddress()} instead.
|
||||
* @return the users bare JID.
|
||||
*/
|
||||
@Deprecated
|
||||
public String getBareAddress() {
|
||||
return userBareAddress.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the users bare address. A bare-address is the address without a resource (ex. derek@jivesoftware.com/spark would
|
||||
* be derek@jivesoftware.com)
|
||||
*
|
||||
* @return the users bare address.
|
||||
*/
|
||||
public EntityBareJid getBareUserAddress() {
|
||||
public EntityBareJid getUserBareAddress() {
|
||||
return userBareAddress;
|
||||
}
|
||||
|
||||
|
||||
@ -356,7 +356,7 @@ public final class SparkManager {
|
||||
* @return the UserDirectory for Spark.
|
||||
*/
|
||||
public static File getUserDirectory() {
|
||||
final String bareJID = sessionManager.getBareUserAddress().asUnescapedString();
|
||||
final String bareJID = sessionManager.getUserBareAddress().asUnescapedString();
|
||||
File userDirectory = new File(Spark.getSparkUserHome(), "/user/" + bareJID);
|
||||
if (!userDirectory.exists()) {
|
||||
userDirectory.mkdirs();
|
||||
|
||||
@ -882,7 +882,7 @@ public class ConferenceRoomBrowser extends JPanel implements ActionListener,
|
||||
}
|
||||
|
||||
List<String> owners = new ArrayList<>();
|
||||
owners.add(SparkManager.getSessionManager().getBareUserAddress().toString());
|
||||
owners.add(SparkManager.getSessionManager().getUserBareAddress().toString());
|
||||
form.setAnswer("muc#roomconfig_roomowners", owners);
|
||||
|
||||
// new DataFormDialog(groupChat, form);
|
||||
|
||||
@ -312,7 +312,7 @@ public class ConferenceUtils {
|
||||
submitForm.setAnswer("muc#roomconfig_roomname", roomName);
|
||||
|
||||
final List<String> owners = new ArrayList<>();
|
||||
owners.add(SparkManager.getSessionManager().getBareAddress());
|
||||
owners.add(SparkManager.getSessionManager().getUserBareAddress().toString());
|
||||
submitForm.setAnswer("muc#roomconfig_roomowners", owners);
|
||||
|
||||
multiUserChat.sendConfigurationForm(submitForm);
|
||||
|
||||
@ -138,7 +138,7 @@ public class ChatRoomImpl extends ChatRoom {
|
||||
);
|
||||
|
||||
final StanzaFilter carbonFilter = new AndFilter(
|
||||
FromMatchesFilter.create( SparkManager.getSessionManager().getBareUserAddress() ), // Security Consideration, see https://xmpp.org/extensions/xep-0280.html#security
|
||||
FromMatchesFilter.create( SparkManager.getSessionManager().getUserBareAddress() ), // Security Consideration, see https://xmpp.org/extensions/xep-0280.html#security
|
||||
new StanzaTypeFilter( Message.class ),
|
||||
new OrFilter(
|
||||
new StanzaExtensionFilter( "sent", CarbonExtension.NAMESPACE ),
|
||||
@ -798,7 +798,7 @@ public class ChatRoomImpl extends ChatRoom {
|
||||
String messageBody = message.getBody();
|
||||
if (nickname.equals(message.getFrom().toString()) || nickname.equals(message.getFrom().asBareJid().toString())) {
|
||||
BareJid otherJID = message.getFrom().asBareJid();
|
||||
EntityBareJid myJID = SparkManager.getSessionManager().getBareUserAddress();
|
||||
EntityBareJid myJID = SparkManager.getSessionManager().getUserBareAddress();
|
||||
|
||||
if (otherJID.equals(myJID)) {
|
||||
nickname = personalNickname;
|
||||
|
||||
@ -196,7 +196,7 @@ public class HistoryTranscript extends SwingWorker {
|
||||
BareJid otherJID = message
|
||||
.getFrom().asBareJid();
|
||||
EntityBareJid myJID = SparkManager.getSessionManager()
|
||||
.getBareUserAddress();
|
||||
.getUserBareAddress();
|
||||
|
||||
if (otherJID.equals(myJID)) {
|
||||
nickname = personalNickname;
|
||||
@ -207,7 +207,7 @@ public class HistoryTranscript extends SwingWorker {
|
||||
}
|
||||
|
||||
if (!from.asBareJid().equals(
|
||||
SparkManager.getSessionManager().getBareUserAddress())) {
|
||||
SparkManager.getSessionManager().getUserBareAddress())) {
|
||||
color = "red";
|
||||
}
|
||||
|
||||
|
||||
@ -81,7 +81,7 @@ public class LocalPreferencePanel extends JPanel {
|
||||
if (!_savePasswordBox.isSelected()) {
|
||||
_autoLoginBox.setSelected(false);
|
||||
try {
|
||||
preferences.clearPasswordForUser(SparkManager.getSessionManager().getBareAddress());
|
||||
preferences.clearPasswordForUser(SparkManager.getSessionManager().getUserBareAddress().toString());
|
||||
} catch (Exception e1) {
|
||||
Log.debug("Unable to clear saved password..." + e1);
|
||||
}
|
||||
|
||||
@ -325,7 +325,7 @@ public final class AgentConversations extends JPanel implements ChangeListener {
|
||||
while (iter.hasNext()) {
|
||||
Affiliate affilitate = (Affiliate)iter.next();
|
||||
Jid jid = affilitate.getJid();
|
||||
if (!jid.equals(SparkManager.getSessionManager().getBareUserAddress())) {
|
||||
if (!jid.equals(SparkManager.getSessionManager().getUserBareAddress())) {
|
||||
list.add(jid);
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ public class ChatHistory extends JPanel {
|
||||
|
||||
|
||||
agentSession = FastpathPlugin.getAgentSession();
|
||||
EntityBareJid jid = SparkManager.getSessionManager().getBareUserAddress();
|
||||
EntityBareJid jid = SparkManager.getSessionManager().getUserBareAddress();
|
||||
try {
|
||||
history = agentSession.getAgentHistory(jid, 10, null);
|
||||
}
|
||||
|
||||
@ -274,7 +274,7 @@ public final class CurrentActivity extends JPanel {
|
||||
while (iter.hasNext()) {
|
||||
Affiliate affilitate = (Affiliate)iter.next();
|
||||
Jid jid = affilitate.getJid();
|
||||
if (!jid.equals(SparkManager.getSessionManager().getBareUserAddress())) {
|
||||
if (!jid.equals(SparkManager.getSessionManager().getUserBareAddress())) {
|
||||
list.add(jid);
|
||||
}
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ public class InvitationPane {
|
||||
while (iter.hasNext()) {
|
||||
Affiliate affilitate = (Affiliate)iter.next();
|
||||
Jid jid = affilitate.getJid();
|
||||
if (!jid.equals(SparkManager.getSessionManager().getBareUserAddress())) {
|
||||
if (!jid.equals(SparkManager.getSessionManager().getUserBareAddress())) {
|
||||
list.add(jid);
|
||||
}
|
||||
}
|
||||
|
||||
@ -334,7 +334,7 @@ public class UserInvitationPane {
|
||||
while (iter.hasNext()) {
|
||||
Affiliate affilitate = iter.next();
|
||||
Jid jid = affilitate.getJid();
|
||||
if (!jid.equals(SparkManager.getSessionManager().getBareUserAddress())) {
|
||||
if (!jid.equals(SparkManager.getSessionManager().getUserBareAddress())) {
|
||||
list.add(jid);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user