Skip to content

Commit de6d5cf

Browse files
authored
Merge pull request #7375 from Countly/SER-2840-apply-android-platform-settings-to-huawei-as-well
[SER-2840] Use Android specific content for Huawei messages
2 parents 824072a + 66fa570 commit de6d5cf

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

plugins/push/api/send/data/message.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,19 +382,22 @@ class Message extends Mongoable {
382382

383383
/**
384384
* Filter contents for given lang-platform combination
385-
*
385+
*
386386
* @param {Content[]|object[]} contents array of contents to filter
387387
* @param {string} p platform key
388388
* @param {string} la language key
389389
* @returns {Content[]} array of contents which are applicable for this p/l case
390390
*/
391391
static filterContents(contents, p, la) {
392-
return (contents || []).filter(c => (!p || (!c.p || c.p === p)) && (!la || (!c.la || c.la === la)));
392+
return (contents || []).filter(
393+
c => (!p || (!c.p || c.p === p || (c.p === "a" && p === "h")))
394+
&& (!la || (!c.la || c.la === la))
395+
);
393396
}
394397

395398
/**
396399
* Get Content instance by p & l given. `content()` returns default content.
397-
*
400+
*
398401
* @param {string} p platform key
399402
* @param {string} la language key
400403
* @returns {Content|undefined} Content instance if one with given p & l exists or undefined

0 commit comments

Comments
 (0)