* @revision 03 * @license http://creativecommons.org/licenses/by-sa/2.0/de/ Creative Commons Attribution-Share Alike 2.0 Germany * @homepage http://oss.tiggerswelt.net/oscar/ * @copyright Copyright © 2008 tiggersWelt.net */ class Oscar_TLV_Avatar extends Oscar_TLV { /* Type of this TLV */ const TYPE = 0x001D; public $ID = 0; public $Flags = 0; public $Hash = ""; // {{{ parse /** * @access public * @return void */ public function parse () { $this->ID = Oscar_Common::str2int16 ($this->Data, 0, true); $this->Flags = Oscar_Common::str2int8 ($this->Data, 0, true); $this->Hash = substr ($this->Data, 1, Oscar_Common::str2int8 ($this->Data)); } // }}} // {{{ generate /** * @access public * @return string */ public function generate () { $this->Data = Oscar_Common::int16tostr ($this->ID) . Oscar_Common::int8tostr ($this->Flags) . Oscar_Common::int8tostr (strlen ($this->Hash)) . $this->Hash; return parent::generate (); } // }}} } ?>