Merge pull request #12123 from annando/issue-11831
Issue 11831: Activate "notify on new post" via API
This commit is contained in:
commit
d0318b3df6
1 changed files with 6 additions and 0 deletions
|
@ -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 a new issue