|
@@ -57,8 +57,6 @@ import java.util.Map;
|
57
|
57
|
import java.util.regex.Matcher;
|
58
|
58
|
import java.util.regex.Pattern;
|
59
|
59
|
|
60
|
|
-import lombok.extern.slf4j.Slf4j;
|
61
|
|
-
|
62
|
60
|
import org.jivesoftware.smack.Chat;
|
63
|
61
|
import org.jivesoftware.smack.ChatManagerListener;
|
64
|
62
|
import org.jivesoftware.smack.ConnectionConfiguration;
|
|
@@ -76,6 +74,7 @@ import org.jivesoftware.smackx.ChatState;
|
76
|
74
|
import org.jivesoftware.smackx.ChatStateListener;
|
77
|
75
|
import org.jivesoftware.smackx.ChatStateManager;
|
78
|
76
|
import org.jivesoftware.smackx.muc.MultiUserChat;
|
|
77
|
+import org.slf4j.LoggerFactory;
|
79
|
78
|
|
80
|
79
|
/**
|
81
|
80
|
* A parser which can understand the XMPP protocol.
|
|
@@ -84,9 +83,10 @@ import org.jivesoftware.smackx.muc.MultiUserChat;
|
84
|
83
|
XmppClientInfo.class, XmppLocalClientInfo.class, XmppFakeChannel.class,
|
85
|
84
|
XmppChannelClientInfo.class
|
86
|
85
|
})
|
87
|
|
-@Slf4j
|
88
|
86
|
public class XmppParser extends BaseSocketAwareParser {
|
89
|
87
|
|
|
88
|
+ private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(XmppParser.class);
|
|
89
|
+
|
90
|
90
|
/** Pattern to use to extract priority. */
|
91
|
91
|
private static final Pattern PRIORITY_PATTERN
|
92
|
92
|
= Pattern.compile("(?i)(?:^|&)priority=([0-9]+)(?:$|&)");
|
|
@@ -130,7 +130,7 @@ public class XmppParser extends BaseSocketAwareParser {
|
130
|
130
|
priority = matcher.find() ? Integer.parseInt(matcher.group(1)) : 0;
|
131
|
131
|
}
|
132
|
132
|
|
133
|
|
- log.debug("XMPP parser created with query string {}, parsed fake channel = {}, priority = {}",
|
|
133
|
+ LOG.debug("XMPP parser created with query string {}, parsed fake channel = {}, priority = {}",
|
134
|
134
|
new Object[] { address.getQuery(), useFakeChannel, priority });
|
135
|
135
|
}
|
136
|
136
|
|
|
@@ -397,7 +397,7 @@ public class XmppParser extends BaseSocketAwareParser {
|
397
|
397
|
@Override
|
398
|
398
|
public void sendMessage(final String target, final String message) {
|
399
|
399
|
if (!chats.containsKey(target)) {
|
400
|
|
- log.debug("Creating new chat for {}", target);
|
|
400
|
+ LOG.debug("Creating new chat for {}", target);
|
401
|
401
|
chats.put(target, connection.getChatManager().createChat(target, new MessageListenerImpl()));
|
402
|
402
|
}
|
403
|
403
|
|
|
@@ -511,7 +511,7 @@ public class XmppParser extends BaseSocketAwareParser {
|
511
|
511
|
}
|
512
|
512
|
}
|
513
|
513
|
} catch (XMPPException ex) {
|
514
|
|
- log.debug("Go an XMPP exception", ex);
|
|
514
|
+ LOG.debug("Go an XMPP exception", ex);
|
515
|
515
|
|
516
|
516
|
connection = null;
|
517
|
517
|
|
|
@@ -536,7 +536,7 @@ public class XmppParser extends BaseSocketAwareParser {
|
536
|
536
|
* @param isBack True if the client is coming back, false if they're going away
|
537
|
537
|
*/
|
538
|
538
|
public void handleAwayStateChange(final XmppClientInfo client, final boolean isBack) {
|
539
|
|
- log.debug("Handling away state change for {} to {}", client.getNickname(), isBack);
|
|
539
|
+ LOG.debug("Handling away state change for {} to {}", client.getNickname(), isBack);
|
540
|
540
|
|
541
|
541
|
if (useFakeChannel) {
|
542
|
542
|
getCallback(OtherAwayStateListener.class)
|
|
@@ -573,7 +573,7 @@ public class XmppParser extends BaseSocketAwareParser {
|
573
|
573
|
/** {@inheritDoc} */
|
574
|
574
|
@Override
|
575
|
575
|
public void setCompositionState(final String host, final CompositionState state) {
|
576
|
|
- log.debug("Setting composition state for {} to {}", host, state);
|
|
576
|
+ LOG.debug("Setting composition state for {} to {}", host, state);
|
577
|
577
|
|
578
|
578
|
final Chat chat = chats.get(parseHostmask(host)[0]);
|
579
|
579
|
|
|
@@ -597,7 +597,7 @@ public class XmppParser extends BaseSocketAwareParser {
|
597
|
597
|
stateManager.setCurrentState(newState, chat);
|
598
|
598
|
} catch (XMPPException ex) {
|
599
|
599
|
// Can't set chat state... Oh well?
|
600
|
|
- log.info("Couldn't set composition state", ex);
|
|
600
|
+ LOG.info("Couldn't set composition state", ex);
|
601
|
601
|
}
|
602
|
602
|
}
|
603
|
603
|
}
|