1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 10:19:41 +02:00

Use Jid (and subclasses) from jxmpp-jid

Fixes SMACK-634
This commit is contained in:
Florian Schmaus 2015-02-14 17:15:02 +01:00
parent 0ee2d9ed1e
commit 5bb4727c57
180 changed files with 1510 additions and 1032 deletions

View file

@ -32,6 +32,8 @@ import org.jivesoftware.smack.util.ObservableWriter;
import org.jivesoftware.smack.util.ReaderListener;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.WriterListener;
import org.jxmpp.jid.FullJid;
import org.jxmpp.jid.Jid;
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
@ -735,12 +737,13 @@ public class EnhancedDebugger implements SmackDebugger {
return writer;
}
public void userHasLogged(final String user) {
@Override
public void userHasLogged(final FullJid user) {
final EnhancedDebugger debugger = this;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
userField.setText(user);
EnhancedDebuggerWindow.userHasLogged(debugger, user);
userField.setText(user.toString());
EnhancedDebuggerWindow.userHasLogged(debugger, user.toString());
// Add the connection listener to the connection so that the debugger can be notified
// whenever the connection is closed.
connection.addConnectionListener(connListener);
@ -795,7 +798,7 @@ public class EnhancedDebugger implements SmackDebugger {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
String messageType;
String from = packet.getFrom();
Jid from = packet.getFrom();
String type = "";
Icon packetTypeIcon;
receivedPackets++;
@ -856,7 +859,7 @@ public class EnhancedDebugger implements SmackDebugger {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
String messageType;
String to = packet.getTo();
Jid to = packet.getTo();
String type = "";
Icon packetTypeIcon;
sentPackets++;

View file

@ -48,7 +48,7 @@ import org.jivesoftware.smack.util.ObservableReader;
import org.jivesoftware.smack.util.ObservableWriter;
import org.jivesoftware.smack.util.ReaderListener;
import org.jivesoftware.smack.util.WriterListener;
import org.jxmpp.util.XmppStringUtils;
import org.jxmpp.jid.FullJid;
/**
* The LiteDebugger is a very simple debugger that allows to debug sent, received and
@ -324,16 +324,11 @@ public class LiteDebugger implements SmackDebugger {
return writer;
}
public void userHasLogged(String user) {
boolean isAnonymous = "".equals(XmppStringUtils.parseLocalpart(user));
@Override
public void userHasLogged(FullJid user) {
String title =
"Smack Debug Window -- "
+ (isAnonymous ? "" : XmppStringUtils.parseBareJid(user))
+ "@"
+ connection.getServiceName()
+ ":"
+ connection.getPort();
title += "/" + XmppStringUtils.parseResource(user);
+ user;
frame.setTitle(title);
}