Ostrzezenie o braku join_url dotyczy juz tylko trybu NONE
`ReminderScheduler` pisal "Przypomnienia pojda bez linku do spotkania" przy
kazdym webinarze z pustym `join_url`, czyli przy KAZDYM webinarze na LiveKit
i Jitsi: pokoj jest tam wewnetrzny, a to pole zostaje puste z zalozenia.
Po dodaniu linku `/spotkanie/{token}` ostrzezenie mowilo administratorowi
NIEPRAWDE, bo link jest w kazdej wiadomosci.
Brak adresu boli naprawde tylko w trybie NONE: tam obraz jest w cudzym
narzedziu, a `join_url` wklejony przez organizatora jest jedyna droga na
spotkanie. Rozstrzyga o tym `supportsRooms()`, czyli to samo zrodlo, ktorego
uzywa `meetingUrlFor` przy skladaniu linku: dwie kopie tej reguly rozjechalyby
sie przy pierwszej poprawce.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -60,6 +60,7 @@ public class ReminderScheduler {
|
||||
private final ReminderSender sender;
|
||||
private final ReminderTextBuilder textBuilder;
|
||||
private final SettingsService settings;
|
||||
private final com.softspm.webinar.video.VideoProviderFactory videoProviders;
|
||||
|
||||
public ReminderScheduler(ReminderRuleRepository ruleRepository,
|
||||
RegistrationRepository registrationRepository,
|
||||
@@ -67,7 +68,8 @@ public class ReminderScheduler {
|
||||
NotificationRepository notificationRepository,
|
||||
ReminderSender sender,
|
||||
ReminderTextBuilder textBuilder,
|
||||
SettingsService settings) {
|
||||
SettingsService settings,
|
||||
com.softspm.webinar.video.VideoProviderFactory videoProviders) {
|
||||
this.ruleRepository = ruleRepository;
|
||||
this.registrationRepository = registrationRepository;
|
||||
this.consentRepository = consentRepository;
|
||||
@@ -75,6 +77,7 @@ public class ReminderScheduler {
|
||||
this.sender = sender;
|
||||
this.textBuilder = textBuilder;
|
||||
this.settings = settings;
|
||||
this.videoProviders = videoProviders;
|
||||
}
|
||||
|
||||
/** Planowanie: co minute szuka regul do zakolejkowania. */
|
||||
@@ -204,13 +207,30 @@ public class ReminderScheduler {
|
||||
: registration.getEmail();
|
||||
}
|
||||
|
||||
/** Ostrzezenie dla administratora, gdy webinar zbliza sie bez linku do spotkania. */
|
||||
/**
|
||||
* Ostrzezenie dla administratora, gdy webinar zbliza sie bez linku do spotkania.
|
||||
*
|
||||
* DOTYCZY WYLACZNIE TRYBU BEZ WLASNEJ SALI
|
||||
* -----------------------------------------------------------------------
|
||||
* Puste `join_url` samo w sobie nie jest bledem: przy LiveKit czy Jitsi
|
||||
* pokoj jest wewnetrzny, a uczestnik wchodzi trasa `/spotkanie/{token}`,
|
||||
* ktora sklada `VideoProviderFactory.meetingUrlFor`. Ostrzeganie o tym
|
||||
* mowilo administratorowi NIEPRAWDE ("przypomnienia pojda bez linku"),
|
||||
* chociaz link jest w kazdej wiadomosci.
|
||||
*
|
||||
* Brak adresu boli naprawde tylko w trybie NONE: tam obraz jest w cudzym
|
||||
* narzedziu, a `join_url` wklejony przez organizatora jest JEDYNA droga
|
||||
* na spotkanie.
|
||||
*/
|
||||
private void warnIfJoinUrlMissing(Webinar webinar, OffsetDateTime now) {
|
||||
if (videoProviders.forWebinar(webinar).supportsRooms()) {
|
||||
return;
|
||||
}
|
||||
boolean missing = webinar.getJoinUrl() == null || webinar.getJoinUrl().isBlank();
|
||||
boolean soon = Duration.between(now, webinar.getStartsAt()).compareTo(JOIN_URL_WARNING_WINDOW) <= 0;
|
||||
if (missing && soon) {
|
||||
log.warn("Webinar {} startuje {} i nie ma ustawionego join_url. "
|
||||
+ "Przypomnienia pojda bez linku do spotkania.",
|
||||
log.warn("Webinar {} startuje {} bez dostawcy wideo i bez join_url. "
|
||||
+ "Uczestnicy nie maja jak wejsc na spotkanie.",
|
||||
webinar.getSlug(), webinar.getStartsAt());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user