diff --git a/config.xml b/config.xml index ae0292fe4..79dd29a95 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + Moodle Moodle official app Moodle Mobile team @@ -28,7 +28,7 @@ - + diff --git a/moodle.config.json b/moodle.config.json index 2fc0be9b2..5340d79db 100644 --- a/moodle.config.json +++ b/moodle.config.json @@ -1,7 +1,7 @@ { "app_id": "com.moodle.moodlemobile", "appname": "Moodle Mobile", - "versioncode": 44000, + "versioncode": 44001, "versionname": "4.4.0", "cache_update_frequency_usually": 420000, "cache_update_frequency_often": 1200000, diff --git a/src/addons/mod/chat/pages/chat/chat.ts b/src/addons/mod/chat/pages/chat/chat.ts index dd0add80e..2c0d46706 100644 --- a/src/addons/mod/chat/pages/chat/chat.ts +++ b/src/addons/mod/chat/pages/chat/chat.ts @@ -166,7 +166,7 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave { const message = this.messages[index]; - if (message.beep && message.beep != String(this.currentUserId)) { + if (message.beep && message.beep !== this.currentUserId) { this.loadMessageBeepWho(message); } } @@ -212,11 +212,11 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave { * @param id User Id before parsing. * @returns User fullname. */ - protected async getUserFullname(id: string): Promise { - const idNumber = parseInt(id, 10); + protected async getUserFullname(id: string | number): Promise { + const idNumber = Number(id); if (isNaN(idNumber)) { - return id; + return String(id); } const user = this.users.find((user) => user.id == idNumber); @@ -235,10 +235,10 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave { return user.fullname; } - return id; + return String(id); } catch { // Ignore errors. - return id; + return String(id); } } diff --git a/src/addons/mod/chat/pages/session-messages/session-messages.ts b/src/addons/mod/chat/pages/session-messages/session-messages.ts index e3143eec7..682bb738e 100644 --- a/src/addons/mod/chat/pages/session-messages/session-messages.ts +++ b/src/addons/mod/chat/pages/session-messages/session-messages.ts @@ -112,7 +112,7 @@ export class AddonModChatSessionMessagesPage implements OnInit { const message = this.messages[index]; - if (message.beep && message.beep != String(this.currentUserId)) { + if (message.beep && message.beep !== this.currentUserId) { this.loadMessageBeepWho(message); } } @@ -135,11 +135,11 @@ export class AddonModChatSessionMessagesPage implements OnInit { * @param id User Id before parsing. * @returns User fullname. */ - protected async getUserFullname(id: string): Promise { - const idNumber = parseInt(id, 10); + protected async getUserFullname(id: string | number): Promise { + const idNumber = Number(id); if (isNaN(idNumber)) { - return id; + return String(id); } try { @@ -148,7 +148,7 @@ export class AddonModChatSessionMessagesPage implements OnInit { return user.fullname; } catch { // Error getting profile. - return id; + return String(id); } } diff --git a/src/addons/mod/chat/services/chat-helper.ts b/src/addons/mod/chat/services/chat-helper.ts index 49f466243..2380408df 100644 --- a/src/addons/mod/chat/services/chat-helper.ts +++ b/src/addons/mod/chat/services/chat-helper.ts @@ -54,6 +54,9 @@ export class AddonModChatHelperProvider { formattedMessage.showDate = this.showDate(message, prevMessage); formattedMessage.beep = (message.message.substring(0, 5) == 'beep ' && message.message.substring(5).trim()) || undefined; + if (formattedMessage.beep && !isNaN(Number(formattedMessage.beep))) { + formattedMessage.beep = Number(formattedMessage.beep); + } formattedMessage.special = !!formattedMessage.beep || ( message).issystem || ( message).system; @@ -133,7 +136,7 @@ export const AddonModChatHelper = makeSingleton(AddonModChatHelperProvider); */ type AddonModChatInfoForView = { showDate?: boolean; // If date should be displayed before the message. - beep?: string; // User id of the beeped user or 'all'. + beep?: string | number; // User id of the beeped user or 'all'. special?: boolean; // True if is an special message (system, beep or command). showUserData?: boolean; // If user data should be displayed. showTail?: boolean; // If tail should be displayed (decoration). diff --git a/src/addons/qtype/ddmarker/classes/ddmarker.ts b/src/addons/qtype/ddmarker/classes/ddmarker.ts index fead3a931..98d937316 100644 --- a/src/addons/qtype/ddmarker/classes/ddmarker.ts +++ b/src/addons/qtype/ddmarker/classes/ddmarker.ts @@ -20,6 +20,8 @@ import { CoreLogger } from '@singletons/logger'; import { AddonQtypeDdMarkerQuestionData } from '../component/ddmarker'; import { AddonQtypeDdMarkerGraphicsApi } from './graphics_api'; import { CoreUtils } from '@services/utils/utils'; +import { CoreDirectivesRegistry } from '@singletons/directives-registry'; +import { CoreExternalContentDirective } from '@directives/external-content'; /** * Class to make a question of ddmarker type work. @@ -678,7 +680,7 @@ export class AddonQtypeDdMarkerQuestion { /** * Wait for the background image to be loaded. */ - pollForImageLoad(): void { + async pollForImageLoad(): Promise { if (this.afterImageLoadDone) { // Already treated. return; @@ -689,6 +691,9 @@ export class AddonQtypeDdMarkerQuestion { return; } + // Wait for external-content to finish, otherwise the image doesn't have a src and the calculations are wrong. + await CoreDirectivesRegistry.waitDirectivesReady(bgImg, undefined, CoreExternalContentDirective); + if (!bgImg.src && this.imgSrc) { bgImg.src = this.imgSrc; }