use of com.faforever.client.chat.event.ChatMessageEvent in project downlords-faf-client by FAForever.
the class PircBotXChatService method onAction.
private void onAction(ActionEvent event) {
User user = event.getUser();
if (user == null) {
logger.warn("Action event without user: {}", event);
return;
}
String source;
org.pircbotx.Channel channel = event.getChannel();
if (channel == null) {
source = user.getNick();
} else {
source = channel.getName();
}
eventBus.post(new ChatMessageEvent(new ChatMessage(source, Instant.ofEpochMilli(event.getTimestamp()), user.getNick(), event.getMessage(), true)));
}
use of com.faforever.client.chat.event.ChatMessageEvent in project downlords-faf-client by FAForever.
the class PircBotXChatService method onMessage.
private void onMessage(MessageEvent event) {
User user = event.getUser();
if (user == null) {
logger.warn("Action event without user: {}", event);
return;
}
String source;
org.pircbotx.Channel channel = event.getChannel();
source = channel.getName();
eventBus.post(new ChatMessageEvent(new ChatMessage(source, Instant.ofEpochMilli(event.getTimestamp()), user.getNick(), event.getMessage(), false)));
}
Aggregations