kiwiirc / kiwibnc

Apache License 2.0
43 stars 14 forks source link

Prepare for push notifier #1

Closed tralves closed 5 years ago

tralves commented 5 years ago

Adds the fcm-node package required to send push notifications.

Avoids error on the bouncer extension when we send BOUNCER changenetwork messages that have other tags than host, port, tls, etc. When we did, the update query returned an error because the object netUpdates was empty and there was nothing to update.

prawnsalad commented 5 years ago

Wasn't the fcm-node package going to be installed by the extension install.sh? We can't expect to install every package that an extension needs into the core.

Also, checking for Object.keys(netUpdates).length === 0 should be around the database update only, as there is the response that needs to be sent at the bottom. https://github.com/prawnsalad/kiwibnc/blob/9cf63b9b3bdd1ac0668636233d1cd99bee246e4d/src/worker/extensions/bouncer/index.js#L361