Added new public_messages with encoder type. Added cases to readMessage function.