Made message signing in Cryptography use SHA512 as the message content for... #1
1 changed files with 32 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
|||
use Socialbox\Classes\Database;
|
||||
use Socialbox\Classes\Logger;
|
||||
use Socialbox\Enums\Flags\PeerFlags;
|
||||
use Socialbox\Enums\PrivacyState;
|
||||
use Socialbox\Enums\ReservedUsernames;
|
||||
use Socialbox\Exceptions\DatabaseOperationException;
|
||||
use Socialbox\Objects\Database\PeerRecord;
|
||||
|
@ -234,6 +235,25 @@
|
|||
throw new DatabaseOperationException('Failed to update the external peer in the database', $e);
|
||||
}
|
||||
|
||||
foreach($peer->getInformationFields() as $informationField)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(PeerInformationManager::fieldExists($existingPeer, $informationField->getName()))
|
||||
{
|
||||
PeerInformationManager::updateField($existingPeer, $informationField->getName(), $informationField->getValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
PeerInformationManager::addField($existingPeer, $informationField->getName(), $informationField->getValue(), PrivacyState::PUBLIC);
|
||||
}
|
||||
}
|
||||
catch(DatabaseOperationException $e)
|
||||
{
|
||||
throw new DatabaseOperationException('Failed to update the external peer information in the database', $e);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -254,6 +274,18 @@
|
|||
{
|
||||
throw new DatabaseOperationException('Failed to synchronize the external peer in the database', $e);
|
||||
}
|
||||
|
||||
foreach($peer->getInformationFields() as $informationField)
|
||||
{
|
||||
try
|
||||
{
|
||||
PeerInformationManager::addField($uuid, $informationField->getName(), $informationField->getValue(), PrivacyState::PUBLIC);
|
||||
}
|
||||
catch(DatabaseOperationException $e)
|
||||
{
|
||||
throw new DatabaseOperationException('Failed to add the external peer information in the database', $e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue