Exemplo n.º 1
0
 public function testSetStatus()
 {
     $request = new TalkRequest();
     $request->setStatus(1);
     $this->assertEquals(1, $request->getStatus());
     $request->setStatus(24);
     $this->assertEquals(24, $request->getStatus());
 }
Exemplo n.º 2
0
 private function talkResponseSend(TalkRequest $talkRequest)
 {
     #print __CLASS__.'->'.__FUNCTION__.''."\n";
     $userNickname = '';
     if ($talkRequest->getStatus() == 1) {
         $userNickname = $this->userNickname;
         // Add to addressbook.
         $contact = new Contact();
         $contact->setNodeId($talkRequest->getClient()->getNode()->getIdHexStr());
         $contact->setUserNickname($talkRequest->getUserNickname());
         $this->ipcKernelConnection->execAsync('addressbookContactAdd', array($contact));
     }
     $this->ipcKernelConnection->execAsync('serverTalkResponseSend', array($talkRequest->getClient(), $talkRequest->getRid(), $talkRequest->getStatus(), $userNickname));
 }