ToothlessGear / node-gcm

A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging
https://github.com/ToothlessGear/node-gcm
Other
1.31k stars 206 forks source link

Delegate responsibility of serialization to Message #139

Closed hypesystem closed 9 years ago

hypesystem commented 9 years ago

The primary purpose of this PR is to move the responsibility for serializing from our abstract representations of Messages to the raw JSON to the Message. Previously, this responsibility was in Sender, which made extending the set of supported parameters very hard.

This PR also changes most tests so they no longer depend on internal state of Message.

The outwards interfaces are unchanged.

I will leave this PR open to comments for 24 hours before merging (until 2015-07-13 15:00 Europe/Copenhagen).