mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-25 13:32:07 +01:00
Fix javadoc warnings and deprecated methods
This commit is contained in:
parent
c351382c73
commit
fe3dcba9b2
11 changed files with 20 additions and 20 deletions
|
@ -235,7 +235,7 @@ public class ChatManager extends Manager{
|
||||||
Chat chat = new Chat(this, userJID, threadID);
|
Chat chat = new Chat(this, userJID, threadID);
|
||||||
threadChats.put(threadID, chat);
|
threadChats.put(threadID, chat);
|
||||||
jidChats.put(userJID, chat);
|
jidChats.put(userJID, chat);
|
||||||
baseJidChats.put(XmppStringUtils.parseBareAddress(userJID), chat);
|
baseJidChats.put(XmppStringUtils.parseBareJid(userJID), chat);
|
||||||
|
|
||||||
for(ChatManagerListener listener : chatManagerListeners) {
|
for(ChatManagerListener listener : chatManagerListeners) {
|
||||||
listener.chatCreated(chat, createdLocally);
|
listener.chatCreated(chat, createdLocally);
|
||||||
|
@ -248,7 +248,7 @@ public class ChatManager extends Manager{
|
||||||
threadChats.remove(chat.getThreadID());
|
threadChats.remove(chat.getThreadID());
|
||||||
String userJID = chat.getParticipant();
|
String userJID = chat.getParticipant();
|
||||||
jidChats.remove(userJID);
|
jidChats.remove(userJID);
|
||||||
baseJidChats.remove(XmppStringUtils.parseBareAddress(userJID));
|
baseJidChats.remove(XmppStringUtils.parseBareJid(userJID));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -294,7 +294,7 @@ public class ChatManager extends Manager{
|
||||||
Chat match = jidChats.get(userJID);
|
Chat match = jidChats.get(userJID);
|
||||||
|
|
||||||
if (match == null && (matchMode == MatchMode.BARE_JID)) {
|
if (match == null && (matchMode == MatchMode.BARE_JID)) {
|
||||||
match = baseJidChats.get(XmppStringUtils.parseBareAddress(userJID));
|
match = baseJidChats.get(XmppStringUtils.parseBareJid(userJID));
|
||||||
}
|
}
|
||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
|
|
|
@ -491,7 +491,7 @@ public class Roster {
|
||||||
* or if no presence information is available..
|
* or if no presence information is available..
|
||||||
*/
|
*/
|
||||||
public Presence getPresence(String user) {
|
public Presence getPresence(String user) {
|
||||||
String key = getPresenceMapKey(XmppStringUtils.parseBareAddress(user));
|
String key = getPresenceMapKey(XmppStringUtils.parseBareJid(user));
|
||||||
Map<String, Presence> userPresences = presenceMap.get(key);
|
Map<String, Presence> userPresences = presenceMap.get(key);
|
||||||
if (userPresences == null) {
|
if (userPresences == null) {
|
||||||
Presence presence = new Presence(Presence.Type.unavailable);
|
Presence presence = new Presence(Presence.Type.unavailable);
|
||||||
|
@ -629,7 +629,7 @@ public class Roster {
|
||||||
}
|
}
|
||||||
String key = user;
|
String key = user;
|
||||||
if (!contains(user)) {
|
if (!contains(user)) {
|
||||||
key = XmppStringUtils.parseBareAddress(user);
|
key = XmppStringUtils.parseBareJid(user);
|
||||||
}
|
}
|
||||||
return key.toLowerCase(Locale.US);
|
return key.toLowerCase(Locale.US);
|
||||||
}
|
}
|
||||||
|
@ -752,7 +752,7 @@ public class Roster {
|
||||||
String user = entry.getUser();
|
String user = entry.getUser();
|
||||||
entries.remove(user);
|
entries.remove(user);
|
||||||
unfiledEntries.remove(entry);
|
unfiledEntries.remove(entry);
|
||||||
presenceMap.remove(XmppStringUtils.parseBareAddress(user));
|
presenceMap.remove(XmppStringUtils.parseBareJid(user));
|
||||||
deletedEntries.add(user);
|
deletedEntries.add(user);
|
||||||
|
|
||||||
for (Entry<String,RosterGroup> e: groups.entrySet()) {
|
for (Entry<String,RosterGroup> e: groups.entrySet()) {
|
||||||
|
@ -1029,7 +1029,7 @@ public class Roster {
|
||||||
|
|
||||||
// Roster push (RFC 6121, 2.1.6)
|
// Roster push (RFC 6121, 2.1.6)
|
||||||
// A roster push with a non-empty from not matching our address MUST be ignored
|
// A roster push with a non-empty from not matching our address MUST be ignored
|
||||||
String jid = XmppStringUtils.parseBareAddress(connection.getUser());
|
String jid = XmppStringUtils.parseBareJid(connection.getUser());
|
||||||
if (rosterPacket.getFrom() != null &&
|
if (rosterPacket.getFrom() != null &&
|
||||||
!rosterPacket.getFrom().equals(jid)) {
|
!rosterPacket.getFrom().equals(jid)) {
|
||||||
LOGGER.warning("Ignoring roster push with a non matching 'from' ourJid=" + jid
|
LOGGER.warning("Ignoring roster push with a non matching 'from' ourJid=" + jid
|
||||||
|
|
|
@ -122,7 +122,7 @@ public class RosterGroup {
|
||||||
}
|
}
|
||||||
// Roster entries never include a resource so remove the resource
|
// Roster entries never include a resource so remove the resource
|
||||||
// if it's a part of the XMPP address.
|
// if it's a part of the XMPP address.
|
||||||
user = XmppStringUtils.parseBareAddress(user);
|
user = XmppStringUtils.parseBareJid(user);
|
||||||
String userLowerCase = user.toLowerCase(Locale.US);
|
String userLowerCase = user.toLowerCase(Locale.US);
|
||||||
synchronized (entries) {
|
synchronized (entries) {
|
||||||
for (RosterEntry entry : entries) {
|
for (RosterEntry entry : entries) {
|
||||||
|
|
|
@ -395,7 +395,7 @@ public interface XMPPConnection {
|
||||||
*
|
*
|
||||||
* @param element
|
* @param element
|
||||||
* @param namespace
|
* @param namespace
|
||||||
* @return
|
* @return true if the server supports the stream feature.
|
||||||
*/
|
*/
|
||||||
public boolean hasFeature(String element, String namespace);
|
public boolean hasFeature(String element, String namespace);
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class FromMatchesFilter implements PacketFilter {
|
||||||
* have a from address.
|
* have a from address.
|
||||||
*/
|
*/
|
||||||
public static FromMatchesFilter createBare(String address) {
|
public static FromMatchesFilter createBare(String address) {
|
||||||
address = (address == null) ? null : XmppStringUtils.parseBareAddress(address);
|
address = (address == null) ? null : XmppStringUtils.parseBareJid(address);
|
||||||
return new FromMatchesFilter(address, true);
|
return new FromMatchesFilter(address, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ public class FromMatchesFilter implements PacketFilter {
|
||||||
// Simplest form of NAMEPREP/STRINGPREP
|
// Simplest form of NAMEPREP/STRINGPREP
|
||||||
from = from.toLowerCase(Locale.US);
|
from = from.toLowerCase(Locale.US);
|
||||||
if (matchBareJID) {
|
if (matchBareJID) {
|
||||||
from = XmppStringUtils.parseBareAddress(from);
|
from = XmppStringUtils.parseBareJid(from);
|
||||||
}
|
}
|
||||||
return from.equals(address);
|
return from.equals(address);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ public class IQReplyFilter implements PacketFilter {
|
||||||
fromFilter.addFilter(FromMatchesFilter.createBare(local));
|
fromFilter.addFilter(FromMatchesFilter.createBare(local));
|
||||||
fromFilter.addFilter(FromMatchesFilter.createFull(server));
|
fromFilter.addFilter(FromMatchesFilter.createFull(server));
|
||||||
}
|
}
|
||||||
else if (to.equals(XmppStringUtils.parseBareAddress(local))) {
|
else if (to.equals(XmppStringUtils.parseBareJid(local))) {
|
||||||
fromFilter.addFilter(FromMatchesFilter.createFull(null));
|
fromFilter.addFilter(FromMatchesFilter.createFull(null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -295,7 +295,7 @@ public class SCRAMSHA1Mechanism extends SASLMechanism {
|
||||||
*
|
*
|
||||||
* @param key
|
* @param key
|
||||||
* @param str
|
* @param str
|
||||||
* @return
|
* @return the HMAC-SHA1 value of the input.
|
||||||
* @throws SmackException
|
* @throws SmackException
|
||||||
*/
|
*/
|
||||||
private static byte[] hmac(byte[] key, byte[] str) throws SmackException {
|
private static byte[] hmac(byte[] key, byte[] str) throws SmackException {
|
||||||
|
@ -317,7 +317,7 @@ public class SCRAMSHA1Mechanism extends SASLMechanism {
|
||||||
* @param str
|
* @param str
|
||||||
* @param salt
|
* @param salt
|
||||||
* @param iterations
|
* @param iterations
|
||||||
* @return
|
* @return the result of the Hi function.
|
||||||
* @throws SmackException
|
* @throws SmackException
|
||||||
*/
|
*/
|
||||||
private static byte[] hi(String str, byte[] salt, int iterations) throws SmackException {
|
private static byte[] hi(String str, byte[] salt, int iterations) throws SmackException {
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class SLF4JSmackDebugger implements SmackDebugger {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getUserTitle(String user) {
|
private String getUserTitle(String user) {
|
||||||
if (("@" + connection.getServiceName()).equals(XmppStringUtils.parseBareAddress(user))) {
|
if (("@" + connection.getServiceName()).equals(XmppStringUtils.parseBareJid(user))) {
|
||||||
return "<Anonymous>@" + connection.getServiceName();
|
return "<Anonymous>@" + connection.getServiceName();
|
||||||
} else {
|
} else {
|
||||||
return user;
|
return user;
|
||||||
|
|
|
@ -328,7 +328,7 @@ public class LiteDebugger implements SmackDebugger {
|
||||||
boolean isAnonymous = "".equals(XmppStringUtils.parseLocalpart(user));
|
boolean isAnonymous = "".equals(XmppStringUtils.parseLocalpart(user));
|
||||||
String title =
|
String title =
|
||||||
"Smack Debug Window -- "
|
"Smack Debug Window -- "
|
||||||
+ (isAnonymous ? "" : XmppStringUtils.parseBareAddress(user))
|
+ (isAnonymous ? "" : XmppStringUtils.parseBareJid(user))
|
||||||
+ "@"
|
+ "@"
|
||||||
+ connection.getServiceName()
|
+ connection.getServiceName()
|
||||||
+ ":"
|
+ ":"
|
||||||
|
|
|
@ -164,7 +164,7 @@ public class MultipleRecipientManager {
|
||||||
// Remove the sender from the TO/CC list (try with bare JID too)
|
// Remove the sender from the TO/CC list (try with bare JID too)
|
||||||
String from = connection.getUser();
|
String from = connection.getUser();
|
||||||
if (!to.remove(from) && !cc.remove(from)) {
|
if (!to.remove(from) && !cc.remove(from)) {
|
||||||
String bareJID = XmppStringUtils.parseBareAddress(from);
|
String bareJID = XmppStringUtils.parseBareJid(from);
|
||||||
to.remove(bareJID);
|
to.remove(bareJID);
|
||||||
cc.remove(bareJID);
|
cc.remove(bareJID);
|
||||||
}
|
}
|
||||||
|
|
|
@ -249,7 +249,7 @@ public class AgentRoster {
|
||||||
private String getPresenceMapKey(String user) {
|
private String getPresenceMapKey(String user) {
|
||||||
String key = user;
|
String key = user;
|
||||||
if (!contains(user)) {
|
if (!contains(user)) {
|
||||||
key = XmppStringUtils.parseBareAddress(user).toLowerCase(Locale.US);
|
key = XmppStringUtils.parseBareJid(user).toLowerCase(Locale.US);
|
||||||
}
|
}
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
@ -323,7 +323,7 @@ public class AgentRoster {
|
||||||
synchronized (entries) {
|
synchronized (entries) {
|
||||||
for (Iterator<String> i = entries.iterator(); i.hasNext();) {
|
for (Iterator<String> i = entries.iterator(); i.hasNext();) {
|
||||||
String entry = i.next();
|
String entry = i.next();
|
||||||
if (entry.toLowerCase(Locale.US).equals(XmppStringUtils.parseBareAddress(key).toLowerCase())) {
|
if (entry.toLowerCase(Locale.US).equals(XmppStringUtils.parseBareJid(key).toLowerCase())) {
|
||||||
fireEvent(EVENT_PRESENCE_CHANGED, packet);
|
fireEvent(EVENT_PRESENCE_CHANGED, packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ public class AgentRoster {
|
||||||
synchronized (entries) {
|
synchronized (entries) {
|
||||||
for (Iterator<String> i = entries.iterator(); i.hasNext();) {
|
for (Iterator<String> i = entries.iterator(); i.hasNext();) {
|
||||||
String entry = (String)i.next();
|
String entry = (String)i.next();
|
||||||
if (entry.toLowerCase(Locale.US).equals(XmppStringUtils.parseBareAddress(key).toLowerCase())) {
|
if (entry.toLowerCase(Locale.US).equals(XmppStringUtils.parseBareJid(key).toLowerCase())) {
|
||||||
fireEvent(EVENT_PRESENCE_CHANGED, packet);
|
fireEvent(EVENT_PRESENCE_CHANGED, packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue