Update connection and chat handling
This commit is contained in:
@@ -7,6 +7,7 @@ import com.ts3client.net.TeamspeakConnection;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Marshals {@link ConnectionListener} callbacks onto the EDT and fans them out to
|
||||
@@ -129,18 +130,34 @@ final class ServerTabConnectionEvents implements ConnectionListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChat(ChatScope scope, int fromClientId, String fromName, String message) {
|
||||
switch (scope) {
|
||||
case PRIVATE:
|
||||
chatPanel.appendPrivateMessage(fromClientId, fromName, fromClientId, fromName, message);
|
||||
break;
|
||||
case SERVER:
|
||||
chatPanel.appendServerMessage(fromClientId, fromName, message);
|
||||
break;
|
||||
default:
|
||||
chatPanel.appendChannelMessage(fromClientId, fromName, message);
|
||||
break;
|
||||
}
|
||||
public void onChat(ChatScope scope, int fromClientId, String fromUniqueId, String fromName, String message) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
switch (scope) {
|
||||
case PRIVATE:
|
||||
chatPanel.appendPrivateMessage(fromClientId, fromUniqueId, fromName,
|
||||
fromClientId, fromUniqueId, fromName, message);
|
||||
break;
|
||||
case SERVER:
|
||||
chatPanel.appendServerMessage(fromClientId, fromUniqueId, fromName, message);
|
||||
break;
|
||||
default:
|
||||
chatPanel.appendChannelMessage(fromClientId, fromUniqueId, fromName, message);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChatHistory(ChatScope scope, List<String> htmlEntries) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
if (scope == ChatScope.SERVER) chatPanel.setServerHistory(htmlEntries);
|
||||
else if (scope == ChatScope.CHANNEL) chatPanel.setChannelHistory(htmlEntries);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPrivateChatHistory(int clientId, String nickname, List<String> htmlEntries) {
|
||||
SwingUtilities.invokeLater(() -> chatPanel.setPrivateHistory(clientId, nickname, htmlEntries));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -165,6 +182,11 @@ final class ServerTabConnectionEvents implements ConnectionListener {
|
||||
SwingUtilities.invokeLater(() -> chatPanel.appendServerLog(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServerLogHtml(String html) {
|
||||
SwingUtilities.invokeLater(() -> chatPanel.appendServerLogHtml(html));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoke(String fromName, String message) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
|
||||
Reference in New Issue
Block a user