Skip to content
Snippets Groups Projects
Commit 5a643c22 authored by Alexis Durgnat's avatar Alexis Durgnat :milky_way:
Browse files

Subscribe to journeys

parent c4591e46
No related branches found
No related tags found
1 merge request!21*poof* final version
......@@ -307,7 +307,7 @@ public class MainWindowController implements Initializable {
messageTextBox.clear();
}
});
// Subscribe to chat message
app.getMessageManager().conditionalSubscribeChatMessage(
chatMessage -> {
Platform.runLater(() -> {
......@@ -322,5 +322,20 @@ public class MainWindowController implements Initializable {
},
chatMessage -> !(app.getUser().get().getIgnoredUserList().contains(chatMessage.getUser()))
);
// Subscribe to joined journey
app.getMessageManager().conditionalSubscribeJoinedJourney( joinedJourney -> {
Platform.runLater(() -> {
User sender = joinedJourney.getUser();
String message = sender.getName() + " voyage !";
if (sender.equals(app.getUser().get())) {
drawMessage(sender, message, AppConfig.CHAT_MESSAGE_ICON_SELF, AppConfig.COLOR_BLUE_10_OPACITY);
} else {
drawMessage(sender, message, AppConfig.CHAT_MESSAGE_ICON, AppConfig.COLOR_BLUE_10_OPACITY);
}
});
},
joinedJourney -> !(app.getUser().get().getIgnoredUserList().contains(joinedJourney.getUser()))
);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment