mirror of https://github.com/pixelfed/pixelfed.git
commit
e9388e6648
|
@ -134,6 +134,7 @@
|
||||||
- Updated Profile, fix follower counter bug. ([d06bec9c](https://github.com/pixelfed/pixelfed/commit/d06bec9c))
|
- Updated Profile, fix follower counter bug. ([d06bec9c](https://github.com/pixelfed/pixelfed/commit/d06bec9c))
|
||||||
- Updated NotificationTransformer, add missing types. ([3a428366](https://github.com/pixelfed/pixelfed/commit/3a428366))
|
- Updated NotificationTransformer, add missing types. ([3a428366](https://github.com/pixelfed/pixelfed/commit/3a428366))
|
||||||
- Updated StatusService, fix json bug. ([1ea2db74](https://github.com/pixelfed/pixelfed/commit/1ea2db74))
|
- Updated StatusService, fix json bug. ([1ea2db74](https://github.com/pixelfed/pixelfed/commit/1ea2db74))
|
||||||
|
- Updated NotificationTransformer, handle tagged deletes. ([881fa865](https://github.com/pixelfed/pixelfed/commit/881fa865))
|
||||||
|
|
||||||
## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9)
|
## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9)
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -74,7 +74,10 @@ class StatusController extends Controller
|
||||||
return redirect('/login?next='.urlencode('/' . $request->path()));
|
return redirect('/login?next='.urlencode('/' . $request->path()));
|
||||||
}
|
}
|
||||||
$id = HashidService::decode($id);
|
$id = HashidService::decode($id);
|
||||||
$status = Status::findOrFail($id);
|
$status = Status::find($id);
|
||||||
|
if(!$status) {
|
||||||
|
return redirect('/404');
|
||||||
|
}
|
||||||
return redirect($status->url());
|
return redirect($status->url());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ namespace App\Jobs\StatusPipeline;
|
||||||
|
|
||||||
use DB;
|
use DB;
|
||||||
use App\{
|
use App\{
|
||||||
|
MediaTag,
|
||||||
Notification,
|
Notification,
|
||||||
Report,
|
Report,
|
||||||
Status,
|
Status,
|
||||||
|
@ -104,6 +105,16 @@ class StatusDelete implements ShouldQueue
|
||||||
Report::whereObjectType('App\Status')
|
Report::whereObjectType('App\Status')
|
||||||
->whereObjectId($status->id)
|
->whereObjectId($status->id)
|
||||||
->delete();
|
->delete();
|
||||||
|
|
||||||
|
MediaTag::where('status_id', $status->id)
|
||||||
|
->cursor()
|
||||||
|
->each(function($tag) {
|
||||||
|
Notification::where('item_type', 'App\MediaTag')
|
||||||
|
->where('item_id', $tag->id)
|
||||||
|
->forceDelete();
|
||||||
|
$tag->delete();
|
||||||
|
});
|
||||||
|
|
||||||
$status->forceDelete();
|
$status->forceDelete();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -37,4 +37,10 @@ class Notification extends Model
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Status::class, 'item_id', 'id');
|
return $this->belongsTo(Status::class, 'item_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function tag()
|
||||||
|
{
|
||||||
|
return $this->hasOne(MediaTag::class, 'item_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ use App\{
|
||||||
Notification,
|
Notification,
|
||||||
Status
|
Status
|
||||||
};
|
};
|
||||||
|
use App\Services\HashidService;
|
||||||
use League\Fractal;
|
use League\Fractal;
|
||||||
|
|
||||||
class NotificationTransformer extends Fractal\TransformerAbstract
|
class NotificationTransformer extends Fractal\TransformerAbstract
|
||||||
|
@ -97,8 +98,8 @@ class NotificationTransformer extends Fractal\TransformerAbstract
|
||||||
$ml = $n->item;
|
$ml = $n->item;
|
||||||
$res = $this->item($ml, function($ml) {
|
$res = $this->item($ml, function($ml) {
|
||||||
return [
|
return [
|
||||||
'username' => $ml->status->profile->username,
|
'username' => $ml->tagged_username,
|
||||||
'post_url' => $ml->status->url()
|
'post_url' => '/p/'.HashidService::encode($ml->status_id)
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
return $res;
|
return $res;
|
||||||
|
|
|
@ -146,7 +146,7 @@
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<p :class="[status.content.length > 620 ? 'mb-1 read-more' : 'mb-1']" style="overflow: hidden;">
|
<p :class="[status.content.length > 620 ? 'mb-1 read-more' : 'mb-1']" style="overflow: hidden;">
|
||||||
<a class="font-weight-bold pr-1 text-dark text-decoration-none" :href="statusProfileUrl">{{statusUsername}}</a>
|
<a class="font-weight-bold pr-1 text-dark text-decoration-none" :href="statusProfileUrl">{{statusUsername}}</a>
|
||||||
<span class="comment-text" style="word-break: break-all;" :id="status.id + '-status-readmore'" v-html="status.content"></span>
|
<span class="comment-text" :id="status.id + '-status-readmore'" v-html="status.content"></span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
Loading…
Reference in New Issue