kopia lustrzana https://github.com/friendica/friendica
Renamed functions
rodzic
591619e1d3
commit
a696b7f427
|
@ -26,7 +26,7 @@ use Friendica\Database\DBA;
|
|||
|
||||
class ListEntity extends BaseFactory
|
||||
{
|
||||
public function create(int $id)
|
||||
public function createFromGroupId(int $id)
|
||||
{
|
||||
$group = DBA::selectFirst('group', ['name'], ['id' => $id, 'deleted' => false]);
|
||||
return new \Friendica\Object\Api\Mastodon\ListEntity($id, $group['name'] ?? '', 'list');
|
||||
|
|
|
@ -29,7 +29,7 @@ use Friendica\Model\Notification as ModelNotification;
|
|||
|
||||
class Notification extends BaseFactory
|
||||
{
|
||||
public function create(int $id)
|
||||
public function createFromNotifyId(int $id)
|
||||
{
|
||||
$notification = DBA::selectFirst('notify', [], ['id' => $id]);
|
||||
if (!DBA::isResult($notification)) {
|
||||
|
|
|
@ -56,7 +56,7 @@ class Lists extends BaseApi
|
|||
if (!empty($cdata['user'])) {
|
||||
$groups = DBA::select('group_member', ['gid'], ['contact-id' => $cdata['user']]);
|
||||
while ($group = DBA::fetch($groups)) {
|
||||
$lists[] = DI::mstdnList()->create($group['gid']);
|
||||
$lists[] = DI::mstdnList()->createFromGroupId($group['gid']);
|
||||
}
|
||||
DBA::close($groups);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ class Lists extends BaseApi
|
|||
|
||||
$groups = DBA::select('group', ['id'], ['uid' => $uid, 'deleted' => false]);
|
||||
while ($group = DBA::fetch($groups)) {
|
||||
$lists[] = DI::mstdnList()->create($group['id']);
|
||||
$lists[] = DI::mstdnList()->createFromGroupId($group['id']);
|
||||
}
|
||||
DBA::close($groups);
|
||||
} else {
|
||||
|
@ -68,7 +68,7 @@ class Lists extends BaseApi
|
|||
if (!DBA::exists('group',['uid' => $uid, 'deleted' => false])) {
|
||||
DI::mstdnError()->RecordNotFound();
|
||||
}
|
||||
$lists = DI::mstdnList()->create($id);
|
||||
$lists = DI::mstdnList()->createFromGroupId($id);
|
||||
}
|
||||
|
||||
System::jsonExit($lists);
|
||||
|
|
|
@ -47,7 +47,7 @@ class Notifications extends BaseApi
|
|||
if (!DBA::exists('notify', ['id' => $id, 'uid' => $uid])) {
|
||||
DI::mstdnError()->RecordNotFound();
|
||||
}
|
||||
System::jsonExit(DI::mstdnNotification()->create($id));
|
||||
System::jsonExit(DI::mstdnNotification()->createFromNotifyId($id));
|
||||
}
|
||||
|
||||
// Return results older than this ID
|
||||
|
@ -110,7 +110,7 @@ class Notifications extends BaseApi
|
|||
|
||||
$notify = DBA::select('notify', ['id'], $condition, $params);
|
||||
while ($notification = DBA::fetch($notify)) {
|
||||
$notifications[] = DI::mstdnNotification()->create($notification['id']);
|
||||
$notifications[] = DI::mstdnNotification()->createFromNotifyId($notification['id']);
|
||||
}
|
||||
|
||||
if (!empty($min_id)) {
|
||||
|
|
Ładowanie…
Reference in New Issue