mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update DirectMessage model
This commit is contained in:
parent
ef184a2cb4
commit
81f23ee970
1 changed files with 4 additions and 4 deletions
|
@ -9,7 +9,7 @@ class DirectMessage extends Model
|
||||||
{
|
{
|
||||||
public function status()
|
public function status()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Status::class, 'id', 'status_id');
|
return $this->belongsTo(Status::class, 'status_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function url()
|
public function url()
|
||||||
|
@ -19,12 +19,12 @@ class DirectMessage extends Model
|
||||||
|
|
||||||
public function author()
|
public function author()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Profile::class, 'id', 'from_id');
|
return $this->belongsTo(Profile::class, 'from_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function recipient()
|
public function recipient()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Profile::class, 'id', 'to_id');
|
return $this->belongsTo(Profile::class, 'to_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function me()
|
public function me()
|
||||||
|
@ -45,6 +45,6 @@ class DirectMessage extends Model
|
||||||
$actorUrl = $this->author->url();
|
$actorUrl = $this->author->url();
|
||||||
$url = $this->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.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue