Merge pull request #1716 from dpalou/MOBILE-2795
MOBILE-2795 messages: Fix videos refreshed when VideoJS is onmain
commit
8e8d770cec
|
@ -132,8 +132,11 @@ export class AddonMessagesDiscussionPage implements OnDestroy {
|
||||||
* @param {boolean} [keep=true] If set the keep flag or not.
|
* @param {boolean} [keep=true] If set the keep flag or not.
|
||||||
*/
|
*/
|
||||||
protected addMessage(message: any, keep: boolean = true): void {
|
protected addMessage(message: any, keep: boolean = true): void {
|
||||||
// Use text instead of message ID because ID changes when a message is read.
|
/* Create a hash to identify the message. The text of online messages isn't reliable because it can have random data
|
||||||
message.hash = Md5.hashAsciiStr(message.text || '') + '#' + message.timecreated + '#' + message.useridfrom;
|
like VideoJS ID. Try to use id and fallback to text for offline messages. */
|
||||||
|
message.hash = Md5.hashAsciiStr(String(message.id || message.text || '')) + '#' + message.timecreated + '#' +
|
||||||
|
message.useridfrom;
|
||||||
|
|
||||||
if (typeof this.keepMessageMap[message.hash] === 'undefined') {
|
if (typeof this.keepMessageMap[message.hash] === 'undefined') {
|
||||||
// Message not added to the list. Add it now.
|
// Message not added to the list. Add it now.
|
||||||
this.messages.push(message);
|
this.messages.push(message);
|
||||||
|
|
Loading…
Reference in New Issue