$toServer = new HubbubServer($p->ownerEntity->ds['server']); tlog($toServer->ds['s_key'] > 0, 'HubbubServer::new('.$p->ownerEntity->ds['server'].')', 'OK ('.$toServer->ds['s_key'].')', 'not loaded'); tlog($toServer->outboundKey() != '', 'HubbubServer->outboundKey()', 'OK ('.$toServer->outboundKey().')', 'not found'); tlog($toServer->inboundKey() != '', 'HubbubServer->inboundKey()', 'OK ('.$toServer->inboundKey().')', 'not found'); $p->signForServer($toServer); tlog($p->signature == md5($toServer->outboundKey().$p->payload), 'HubbubMessage::signForServer('.$p->ownerEntity->ds['server'].')', 'OK ('.$p->signature.')', 'invalid signature'); tlog($p->validateSignature(), 'HubbubMessage->validateSignature(valid)', 'OK', 'failure'); $p->signature = md5($p->signature); $GLOBALS['nolog'] = true; // disable logging, because we'll trigger an error here tlog(!$p->validateSignature(), 'HubbubMessage->validateSignature(invalid)', 'OK', 'failure'); $GLOBALS['nolog'] = false; $p->signForServer($toServer); $r = new HubbubMessage(); $r->receive($p->payload, $p->signature); tlog($r->validateSignature(), 'HubbubMessage->receive() signature', 'OK', 'failure ('.$p->expectedSignature.')'); tsection('Friends'); $url = $ne2->ds['url']; require_once('lib/hubbub2_loadurl.php'); $er = hubbub2_loadurl($url); tlog(!(sizeof($er) == 0 || $er['user'] == '' || $er['server'] == ''), 'hubbub2_loadurl('.$url.')', 'OK ('.$er['user'].'@'.$er['server'].')', 'failure'); $res = $p->sendToUrl($er['server']); tlog($res['result'] == 'OK', 'HubbubMessage->sendToUrl('.$url.') Message '.$p->data['msgid'], 'OK ('.json_encode($res).')', 'fail ('.$res['reason'].')'); $con1 = new HubbubConnection($p->authorEntity->key(), $p->ownerEntity->key()); $con2 = new HubbubConnection($p->ownerEntity->key(), $p->authorEntity->key()); tlog($con1->ds['c_status'] == 'req.sent', 'HubbubConnection status '.$u1name.':'.$con1->ds['c_from'].' to '.$u2name.':'.$con1->ds['c_to'].' == req.sent', 'OK', 'fail ('.$con1->ds['c_status'].')'); tlog($con2->ds['c_status'] == 'req.rcv', 'HubbubConnection status '.$u2name.':'.$con2->ds['c_from'].' to '.$u1name.':'.$con2->ds['c_to'].' == req.rcv', 'OK', 'fail ('.json_encode($con2->ds).')'); // if everything went right, there should be a friend request waiting for user u1