Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix new event documentation #490

Merged
merged 4 commits into from
Sep 15, 2020
Merged

fix new event documentation #490

merged 4 commits into from
Sep 15, 2020

Conversation

sualko
Copy link
Member

@sualko sualko commented Sep 5, 2020

No description provided.

@sualko sualko changed the title fix typo in new event docu fix new event documentation Sep 5, 2020
docs/create.md Outdated Show resolved Hide resolved
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, apart from the setObject change

@sualko
Copy link
Member Author

sualko commented Sep 10, 2020

This pr just reflects the code documentation: https://github.com/nextcloud/server/blob/f91a85c32eb4a4c3cef20e0daab4069437df5d07/lib/public/Activity/IManager.php#L38-L51

        /**
	 * Generates a new IEvent object
	 *
	 * Make sure to call at least the following methods before sending it to the
	 * app with via the publish() method:
	 *  - setApp()
	 *  - setType()
	 *  - setAffectedUser()
	 *  - setSubject()
	 *
	 * @return IEvent
	 * @since 8.2.0
	 */
	public function generateEvent(): IEvent;

So if setObject should be mandatory, at lest the code should be updated as well. Btw I have no clue what the difference is between all those functions. I can only make an reasonable assumption based on other apps, but I'm not sure what is best practice and how should it be used. Therefore some documentation from someone with more knowledge would be helpful.

@nickvergessen
Copy link
Member

Ah oh... hmm then let me fix server and you move setObject() back here

@sualko
Copy link
Member Author

sualko commented Sep 10, 2020

you move setObject() back here

No problem. Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants