-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure and clean up message and presencemessage types
- extract common functionality to a new BaseMessage file - introduce proper WireMessage and WirePresenceMessage classes, such that: - you just call Message.encode() to get a WireMessage, and WireMessage.decode() to get a Message, and the type system will tell you which one you have - the toJSON override hack only applies to internal wire-protocol uses and doesn't interfere with the normal public Message/PresenceMessage classes - all necessary transformations between userfriendly message and wire protocol messages (encoding the data and the action) are now done by decode() and encode(), rather than (as before) the encoding happening in-place and the action encoding happening only on json-stringification - ProtocolMessage is now always a wire-protocol message and always holds WireMessages and WirePresence; all decoding is done by the channel - The PresencePlugin interface is now just the PresenceMessage and WirePresenceMessage types, rather than ad-hoc individual functions - The fromWireProtocol, encode, and decode functions in the DefaultMessage interface are no longer needed and can be removed - Cleaned up and simplified the message decoding step in the channel, which was unnecessarily complicated
- Loading branch information
1 parent
cd1fc99
commit 9635f30
Showing
29 changed files
with
1,022 additions
and
1,093 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.