Skip to content

Commit 741801f

Browse files
author
Cihad Tekin
committed
[push] replaced xxhash-addon with md5
1 parent eb3c24e commit 741801f

File tree

6 files changed

+135
-159
lines changed

6 files changed

+135
-159
lines changed

plugins/push/api/send/platforms/a.js

+24-24
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const key = 'a';
1818
* - has its own compilation part;
1919
* - has its own sending part;
2020
* - has no distinct representation in UI, therefore it's virtual.
21-
*
21+
*
2222
* Huawei push is only available on select Android devices, therefore it doesn't deserve a separate checkbox in UI from users perspective.
2323
* Yet notification payload, provider communication and a few other things are different, therefore it's a virtual platform. You can send to huawei directly using
2424
* API, but whenever you send to Android you'll also send to huawei if Huawei credentials are set.
@@ -27,20 +27,20 @@ const virtuals = ['h'];
2727

2828
/**
2929
* Extract token & field from token_session request
30-
*
30+
*
3131
* @param {object} qstring request params
3232
* @returns {string[]|undefined} array of [platform, field, token] if qstring has platform-specific token data, undefined otherwise
3333
*/
3434
function extractor(qstring) {
3535
if (qstring.android_token !== undefined && (!qstring.token_provider || qstring.token_provider === 'FCM')) {
3636
const token = qstring.android_token === 'BLACKLISTED' ? '' : qstring.android_token;
37-
return [key, FIELDS['0'], token, util.hashInt(token)];
37+
return [key, FIELDS['0'], token, util.hash(token)];
3838
}
3939
}
4040

4141
/**
4242
* Make an estimated guess about request platform
43-
*
43+
*
4444
* @param {string} userAgent user-agent header
4545
* @returns {string} platform key if it looks like request made by this platform
4646
*/
@@ -56,7 +56,7 @@ class FCM extends Splitter {
5656
* Standard constructor
5757
* @param {string} log logger name
5858
* @param {string} type type of connection: ap, at, id, ia, ip, ht, hp
59-
* @param {Credentials} creds FCM credentials
59+
* @param {Credentials} creds FCM credentials
6060
* @param {Object[]} messages initial array of messages to send
6161
* @param {Object} options standard stream options
6262
* @param {number} options.pool.pushes number of notifications which can be processed concurrently, this parameter is strictly set to 500
@@ -90,8 +90,8 @@ class FCM extends Splitter {
9090
}
9191

9292
/**
93-
* Compile & send messages
94-
*
93+
* Compile & send messages
94+
*
9595
* @param {Object[]} data pushes to send, no more than 500 per function call as enforced by stream writableHighWaterMark
9696
* @param {integer} length number of bytes in data
9797
* @returns {Promise} sending promise
@@ -217,7 +217,7 @@ class FCM extends Splitter {
217217

218218
/**
219219
* Create new empty payload for the note object given
220-
*
220+
*
221221
* @param {Message} msg NMessageote object
222222
* @returns {object} empty payload object
223223
*/
@@ -227,7 +227,7 @@ function empty(msg) {
227227

228228
/**
229229
* Finish data object after setting all the properties
230-
*
230+
*
231231
* @param {object} data platform-specific data to finalize
232232
* @return {object} resulting object
233233
*/
@@ -256,7 +256,7 @@ const fields = [
256256
*/
257257
const map = {
258258
/**
259-
* Sends sound
259+
* Sends sound
260260
* @param {Template} t template
261261
* @param {string} sound sound string
262262
*/
@@ -267,7 +267,7 @@ const map = {
267267
},
268268

269269
/**
270-
* Sends badge
270+
* Sends badge
271271
* @param {Template} t template
272272
* @param {number} badge badge (0..N)
273273
*/
@@ -278,7 +278,7 @@ const map = {
278278
/**
279279
* Sends buttons
280280
* !NOTE! buttons & messagePerLocale are inter-dependent as buttons urls/titles are locale-specific
281-
*
281+
*
282282
* @param {Template} t template
283283
* @param {number} buttons buttons (1..2)
284284
*/
@@ -290,7 +290,7 @@ const map = {
290290

291291
/**
292292
* Set title string
293-
*
293+
*
294294
* @param {Template} t template
295295
* @param {String} title title string
296296
*/
@@ -300,7 +300,7 @@ const map = {
300300

301301
/**
302302
* Set message string
303-
*
303+
*
304304
* @param {Template} t template
305305
* @param {String} message message string
306306
*/
@@ -310,7 +310,7 @@ const map = {
310310

311311
/**
312312
* Send collapse_key.
313-
*
313+
*
314314
* @param {Template} template template
315315
* @param {boolean} ck collapseKey of the Content
316316
*/
@@ -322,7 +322,7 @@ const map = {
322322

323323
/**
324324
* Send timeToLive.
325-
*
325+
*
326326
* @param {Template} template template
327327
* @param {boolean} ttl timeToLive of the Content
328328
*/
@@ -334,7 +334,7 @@ const map = {
334334

335335
/**
336336
* Send notification-tap url
337-
*
337+
*
338338
* @param {Template} template template
339339
* @param {string} url on-tap url
340340
*/
@@ -345,7 +345,7 @@ const map = {
345345
/**
346346
* Send media (picture, video, gif, etc) along with the message.
347347
* Sets mutable-content in order for iOS extension to be run.
348-
*
348+
*
349349
* @param {Template} template template
350350
* @param {string} media attached media url
351351
*/
@@ -355,7 +355,7 @@ const map = {
355355

356356
/**
357357
* Sends custom data along with the message
358-
*
358+
*
359359
* @param {Template} template template
360360
* @param {Object} data data to be sent
361361
*/
@@ -365,7 +365,7 @@ const map = {
365365

366366
/**
367367
* Sends user props along with the message
368-
*
368+
*
369369
* @param {Template} template template
370370
* @param {[string]} extras extra user props to be sent
371371
* @param {Object} data personalization
@@ -381,7 +381,7 @@ const map = {
381381

382382
/**
383383
* Sends platform specific fields
384-
*
384+
*
385385
* @param {Template} template template
386386
* @param {object} specific platform specific props to be sent
387387
*/
@@ -417,7 +417,7 @@ const CREDS = {
417417
'fcm': class FCMCreds extends Creds {
418418
/**
419419
* Validation scheme of this class
420-
*
420+
*
421421
* @returns {object} validateArgs scheme
422422
*/
423423
static get scheme() {
@@ -429,7 +429,7 @@ const CREDS = {
429429

430430
/**
431431
* Check credentials for correctness, throw PushError otherwise
432-
*
432+
*
433433
* @throws PushError in case the check fails
434434
* @returns {undefined}
435435
*/
@@ -469,7 +469,7 @@ const CREDS = {
469469

470470
/**
471471
* "View" json, that is some truncated/simplified version of credentials that is "ok" to display
472-
*
472+
*
473473
* @returns {object} json without sensitive information
474474
*/
475475
get view() {

0 commit comments

Comments
 (0)