1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-26 17:56:48 +00:00

Merge pull request #2450 from pixelfed/staging

Update DirectMessage model
This commit is contained in:
daniel 2020-11-25 10:42:34 -07:00 committed by GitHub
commit 907c96ea9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ class DirectMessage extends Model
{
public function status()
{
return $this->hasOne(Status::class, 'id', 'status_id');
return $this->belongsTo(Status::class, 'status_id', 'id');
}
public function url()
@ -19,12 +19,12 @@ class DirectMessage extends Model
public function author()
{
return $this->hasOne(Profile::class, 'id', 'from_id');
return $this->belongsTo(Profile::class, 'from_id', 'id');
}
public function recipient()
{
return $this->hasOne(Profile::class, 'id', 'to_id');
return $this->belongsTo(Profile::class, 'to_id', 'id');
}
public function me()
@ -45,6 +45,6 @@ class DirectMessage extends Model
$actorUrl = $this->author->url();
$url = $this->url();
return "<a href='{$actorUrl}' class='profile-link'>{$actorName}</a> sent a <a href='{$url}' class='dm-link'>direct message</a>.";
return "{$actorName} sent a direct message.";
}
}