Issue 11831: Activate "notify on new post" via API
This commit is contained in:
parent
b9f0985467
commit
bc7d21183d
|
@ -40,6 +40,10 @@ class Follow extends BaseApi
|
|||
DI::mstdnError()->UnprocessableEntity();
|
||||
}
|
||||
|
||||
$request = $this->getRequest([
|
||||
'notify' => false, // Notify on new posts.
|
||||
], $request);
|
||||
|
||||
$contact = Contact::getById($this->parameters['id'], ['url']);
|
||||
|
||||
$result = Contact::createFromProbeForUser($uid, $contact['url']);
|
||||
|
@ -48,6 +52,8 @@ class Follow extends BaseApi
|
|||
DI::mstdnError()->UnprocessableEntity($result['message']);
|
||||
}
|
||||
|
||||
Contact::update(['notify_new_posts' => $request['notify']], ['id' => $result['cid']]);
|
||||
|
||||
System::jsonExit(DI::mstdnRelationship()->createFromContactId($result['cid'], $uid)->toArray());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user