diff --git a/src/Models/BaseMessage.php b/src/Models/BaseMessage.php index 784d6d5..626013a 100644 --- a/src/Models/BaseMessage.php +++ b/src/Models/BaseMessage.php @@ -151,13 +151,6 @@ function( $obj ) use ($cipherParams) { return static::fromEncoded($obj, $cipherP protected function encode() { $msg = new \stdClass(); - if ($this->encoding) { - $msg->encoding = $this->encoding; - $msg->data = $this->data; - - return $msg; - } - if ($this->id) { $msg->id = $this->id; } @@ -170,6 +163,13 @@ protected function encode() { $msg->extras = $this->extras; } + if ($this->encoding) { + $msg->encoding = $this->encoding; + $msg->data = $this->data; + + return $msg; + } + $isBinary = false; $encodings = [];