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

Add leftJourney sub

parent 45818ca6
No related branches found
No related tags found
1 merge request!21*poof* final version
...@@ -336,5 +336,20 @@ public class MainWindowController implements Initializable { ...@@ -336,5 +336,20 @@ public class MainWindowController implements Initializable {
}, },
joinedJourney -> !(app.getUser().get().getIgnoredUserList().contains(joinedJourney.getUser())) joinedJourney -> !(app.getUser().get().getIgnoredUserList().contains(joinedJourney.getUser()))
); );
// Subscribe to left journey
app.getMessageManager().conditionalSubscribeLeftJourney( leftJourney -> {
Platform.runLater(() -> {
User sender = leftJourney.getUser();
String message = sender.getName() + " a terminé son 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);
}
});
},
leftJourney -> !(app.getUser().get().getIgnoredUserList().contains(leftJourney.getUser()))
);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment