Adds an update to a room’s update list via storage.
Parameters
$roomstringrequired- Room identifier.
$client_idintrequired- Client identifier.
$typestringrequired- Update type (sync_step1, sync_step2, update, compaction).
$datastringrequired- Base64-encoded update data.
Source
private function add_update( string $room, int $client_id, string $type, string $data ) {
$update = array(
'client_id' => $client_id,
'data' => $data,
'type' => $type,
);
if ( ! $this->storage->add_update( $room, $update ) ) {
return new WP_Error(
'rest_sync_storage_error',
__( 'Failed to store sync update.' ),
array( 'status' => 500 )
);
}
return true;
}
Changelog
| Version | Description |
|---|---|
| 7.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.