Merge pull request #3690 from alfonso-salces/MOBILE-4344

[4.3] MOBILE-4344 cron: Check notification and messages
main
Dani Palou 2023-06-13 15:01:42 +02:00 committed by GitHub
commit 6517e108ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -191,7 +191,14 @@ export class AddonMessagesMainMenuHandlerService implements CoreMainMenuHandler,
* @returns Promise resolved when done, rejected if failure.
*/
async execute(siteId?: string): Promise<void> {
if (!CoreSites.isCurrentSite(siteId)) {
const site = CoreSites.getCurrentSite();
if (
!CoreSites.isCurrentSite(siteId) ||
!site ||
site.isFeatureDisabled('CoreMainMenuDelegate_AddonMessages') ||
!site.canUseAdvancedFeature('messaging')
) {
return;
}

View File

@ -67,7 +67,13 @@ export class AddonNotificationsCronHandlerService implements CoreCronHandler {
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async execute(siteId?: string, force?: boolean): Promise<void> {
if (!CoreSites.isCurrentSite(siteId)) {
const site = CoreSites.getCurrentSite();
if (
!CoreSites.isCurrentSite(siteId) ||
!site ||
site.isFeatureDisabled('CoreMainMenuDelegate_AddonNotifications')
) {
return;
}