* @revision 03 * @license http://creativecommons.org/licenses/by-sa/3.0/de/ Creative Commons Attribution-Share Alike 3.0 Germany * @homepage http://oss.tiggerswelt.net/oscar/ * @copyright Copyright © 2009 tiggersWelt.net */ /** * This SNAC is received from server when someone else wants to add you to his roster * * @remark Don't use this SNAC when in client-mode, just handle it * * @class Oscar_SNAC_Feedbag_AuthRequest **/ class Oscar_SNAC_Feedbag_AuthRequest extends Oscar_SNAC { /* About this SNAC */ const SNAC_FAMILY = 0x0013; const SNAC_SERVICE = 0x0019; public $Username = ""; public $Reason = ""; /** * This is the same as SNAC_SSI_Request_Authorization but vice-versa **/ // {{{ parse /** * Parse this SNAC and run callbacks * * @access public * @return void */ public function parse () { // Parse this SNAC if ($this->Data [0] == chr (0)) Oscar_Common::string16 ($this->Data, 0, true); $this->Username = Oscar_Common::string08 ($this->Data, 0, true); $this->Reason = Oscar_Common::string16 ($this->Data, 0, true); // Try to run callbacks if (is_object ($this->Parent)) { // Run the callback $rc = $this->Parent->authorizationRequest ($this->Username, $this->Reason); // Check the result if ($rc === true) $this->Parent->acceptAuthorization ($this->Username); elseif ($rc === false) $this->Parent->rejectAuthorization ($this->Username); } } // }}} } ?>