Skip to content

Commit

Permalink
Revert 64bit requirement
Browse files Browse the repository at this point in the history
There is no reason for it, the timestamps can be float with no precision loss until October 12, year 287396.
  • Loading branch information
mormegil-cz committed Dec 22, 2023
1 parent f81054f commit 6302c0c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ Note: Nextcloud 20 support will be dropped in Oct 2021, this is very likely the
There are no additional changes compared to the latest beta.

### Changed
- News now requires a 64bit OS
- ~~News now requires a 64bit OS~~ – reverted in this fork
- v2 API implementation (folder part)
- Implemented sharing news items between nextcloud users (#1191)
- Updated the news items table in DB to include sharer data (#1191)
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Report a [feed issue](https://github.com/nextcloud/news/discussions/new)
<screenshot small-thumbnail="https://raw.githubusercontent.com/nextcloud/news/master/screenshots/2-small.png">https://raw.githubusercontent.com/nextcloud/news/master/screenshots/2.png</screenshot>
<screenshot small-thumbnail="https://raw.githubusercontent.com/nextcloud/news/master/screenshots/3-small.png">https://raw.githubusercontent.com/nextcloud/news/master/screenshots/3.png</screenshot>
<dependencies>
<php min-version="8.0" min-int-size="64"/>
<php min-version="8.0"/>
<database min-version="10">pgsql</database>
<database>sqlite</database>
<database min-version="8.0">mysql</database>
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/ItemApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ public function index(
*
* @param int $type
* @param int $id
* @param int $lastModified
* @param float $lastModified
* @return array|JSONResponse
*
* @throws ServiceValidationException
*/
public function updated(int $type = 3, int $id = 0, int $lastModified = 0): array
public function updated(int $type = 3, int $id = 0, float $lastModified = 0): array
{
// needs to be turned into a millisecond timestamp to work properly
if (strlen((string) $lastModified) <= 10) {
Expand Down
12 changes: 6 additions & 6 deletions lib/Db/ItemMapperV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,15 +328,15 @@ public function newest(string $userId): Entity
/**
* @param string $userId
* @param int $feedId
* @param int $updatedSince
* @param float $updatedSince
* @param bool $hideRead
*
* @return Item[]
*/
public function findAllInFeedAfter(
string $userId,
int $feedId,
int $updatedSince,
float $updatedSince,
bool $hideRead
): array {
$builder = $this->db->getQueryBuilder();
Expand Down Expand Up @@ -366,15 +366,15 @@ public function findAllInFeedAfter(
/**
* @param string $userId
* @param int|null $folderId
* @param int $updatedSince
* @param float $updatedSince
* @param bool $hideRead
*
* @return Item[]
*/
public function findAllInFolderAfter(
string $userId,
?int $folderId,
int $updatedSince,
float $updatedSince,
bool $hideRead
): array {
$builder = $this->db->getQueryBuilder();
Expand All @@ -400,13 +400,13 @@ public function findAllInFolderAfter(

/**
* @param string $userId
* @param int $updatedSince
* @param float $updatedSince
* @param int $feedType
*
* @return Item[]|Entity[]
* @throws ServiceValidationException
*/
public function findAllAfter(string $userId, int $feedType, int $updatedSince): array
public function findAllAfter(string $userId, int $feedType, float $updatedSince): array
{
$builder = $this->db->getQueryBuilder();

Expand Down
12 changes: 6 additions & 6 deletions lib/Service/ItemServiceV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@ public function findAllInFeed(string $userId, int $feedId): array
* Returns all new items in a feed
* @param string $userId the name of the user
* @param int $feedId the id of the feed
* @param int $updatedSince a timestamp with the minimal modification date
* @param float $updatedSince a timestamp with the minimal modification date
* @param boolean $hideRead if unread items should also be returned
*
* @return array of items
*/
public function findAllInFeedAfter(string $userId, int $feedId, int $updatedSince, bool $hideRead): array
public function findAllInFeedAfter(string $userId, int $feedId, float $updatedSince, bool $hideRead): array
{
return $this->mapper->findAllInFeedAfter($userId, $feedId, $updatedSince, $hideRead);
}
Expand All @@ -291,12 +291,12 @@ public function findAllInFeedAfter(string $userId, int $feedId, int $updatedSinc
* Returns all new items in a folder
* @param string $userId the name of the user
* @param int|null $folderId the id of the folder
* @param int $updatedSince a timestamp with the minimal modification date
* @param float $updatedSince a timestamp with the minimal modification date
* @param boolean $hideRead if unread items should also be returned
*
* @return array of items
*/
public function findAllInFolderAfter(string $userId, ?int $folderId, int $updatedSince, bool $hideRead): array
public function findAllInFolderAfter(string $userId, ?int $folderId, float $updatedSince, bool $hideRead): array
{
return $this->mapper->findAllInFolderAfter($userId, $folderId, $updatedSince, $hideRead);
}
Expand All @@ -306,13 +306,13 @@ public function findAllInFolderAfter(string $userId, ?int $folderId, int $update
*
* @param string $userId the name of the user
* @param int $feedType the type of feed items to fetch. (starred || unread)
* @param int $updatedSince a timestamp with the minimal modification date
* @param float $updatedSince a timestamp with the minimal modification date
*
* @return array of items
*
* @throws ServiceValidationException
*/
public function findAllAfter(string $userId, int $feedType, int $updatedSince): array
public function findAllAfter(string $userId, int $feedType, float $updatedSince): array
{
if (!in_array($feedType, [ListType::STARRED, ListType::UNREAD, ListType::ALL_ITEMS], true)) {
throw new ServiceValidationException('Trying to find in unknown type');
Expand Down

0 comments on commit 6302c0c

Please sign in to comment.