Support for receiving null messages
Just log em for debugging. Also update the error messge thrown when we get a content message with no supported properties. It may be empty or may just have an unrecognized field. // FREEBIE
This commit is contained in:
@@ -38444,11 +38444,17 @@ MessageReceiver.prototype.extend({
|
||||
return this.handleSyncMessage(envelope, content.syncMessage);
|
||||
} else if (content.dataMessage) {
|
||||
return this.handleDataMessage(envelope, content.dataMessage);
|
||||
} else if (content.nullMessage) {
|
||||
return this.handleNullMessage(envelope, content.nullMessage);
|
||||
} else {
|
||||
throw new Error('Got Content message with no dataMessage and no syncMessage');
|
||||
throw new Error('Unsupported content message');
|
||||
}
|
||||
}.bind(this));
|
||||
},
|
||||
handleNullMessage: function(envelope, nullMessage) {
|
||||
var encodedNumber = envelope.source + '.' + envelope.sourceDevice;
|
||||
console.log('null message from', encodedNumber, envelope.timestamp.toNumber());
|
||||
},
|
||||
handleSyncMessage: function(envelope, syncMessage) {
|
||||
if (envelope.source !== this.number) {
|
||||
throw new Error('Received sync message from another number');
|
||||
|
Reference in New Issue
Block a user