Merge pull request #3604 from pixelfed/staging

Staging
This commit is contained in:
daniel 2022-08-04 02:59:03 -06:00 committed by GitHub
commit 0f5bf8b4b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View file

@ -49,6 +49,7 @@
- Update unfollow api endpoint to only decrement when appropriate, fixes #3539 ([44de1ad7](https://github.com/pixelfed/pixelfed/commit/44de1ad7)) - Update unfollow api endpoint to only decrement when appropriate, fixes #3539 ([44de1ad7](https://github.com/pixelfed/pixelfed/commit/44de1ad7))
- Improve cache invalidation after processing VideoThumbnail to eliminate "No Preview Available" on grid feeds ([47571887](https://github.com/pixelfed/pixelfed/commit/47571887)) - Improve cache invalidation after processing VideoThumbnail to eliminate "No Preview Available" on grid feeds ([47571887](https://github.com/pixelfed/pixelfed/commit/47571887))
- Use poster in VideoPresenter component ([a3cc90b0](https://github.com/pixelfed/pixelfed/commit/a3cc90b0)) - Use poster in VideoPresenter component ([a3cc90b0](https://github.com/pixelfed/pixelfed/commit/a3cc90b0))
- Fix mastoapi notification type casting to include comment and share (mention and reblog) notifications ([eba84530](https://github.com/pixelfed/pixelfed/commit/eba84530))
- ([](https://github.com/pixelfed/pixelfed/commit/)) - ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.3 (2022-05-09)](https://github.com/pixelfed/pixelfed/compare/v0.11.2...v0.11.3) ## [v0.11.3 (2022-05-09)](https://github.com/pixelfed/pixelfed/compare/v0.11.2...v0.11.3)

View file

@ -105,7 +105,7 @@ class NotificationService {
$res = collect([]); $res = collect([]);
foreach($ids as $id) { foreach($ids as $id) {
$n = self::getNotification($id); $n = self::rewriteMastodonTypes(self::getNotification($id));
if($n != null && in_array($n['type'], self::MASTODON_TYPES)) { if($n != null && in_array($n['type'], self::MASTODON_TYPES)) {
$n['account'] = AccountService::getMastodon($n['account']['id']); $n['account'] = AccountService::getMastodon($n['account']['id']);
@ -133,7 +133,7 @@ class NotificationService {
$res = collect([]); $res = collect([]);
foreach($ids as $id) { foreach($ids as $id) {
$n = self::getNotification($id); $n = self::rewriteMastodonTypes(self::getNotification($id));
if($n != null && in_array($n['type'], self::MASTODON_TYPES)) { if($n != null && in_array($n['type'], self::MASTODON_TYPES)) {
$n['account'] = AccountService::getMastodon($n['account']['id']); $n['account'] = AccountService::getMastodon($n['account']['id']);
@ -175,6 +175,23 @@ class NotificationService {
])); ]));
} }
public static function rewriteMastodonTypes($notification)
{
if(!$notification || !isset($notification['type'])) {
return $notification;
}
if($notification['type'] === 'comment') {
$notification['type'] = 'mention';
}
if($notification['type'] === 'share') {
$notification['type'] = 'reblog';
}
return $notification;
}
public static function set($id, $val) public static function set($id, $val)
{ {
return Redis::zadd(self::CACHE_KEY . $id, $val, $val); return Redis::zadd(self::CACHE_KEY . $id, $val, $val);