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

Add ability to invite groups #1268

Merged
merged 5 commits into from
Nov 9, 2018
Merged

Conversation

mario
Copy link
Contributor

@mario mario commented Oct 25, 2018

I want to have the ability to invite groups to a conversation, as well as users. Re-using the existing endpoint sounds sane to me so this is my attempt.

Be gentle! :)


Todos:

  • Extend endpoint to allow adding groups
  • Add option in the UI
  • Merge email-invites into this new universal add-endpoint

@mario mario force-pushed the add-ability-to-invite-groups branch from a08bdb7 to e7cffa7 Compare October 25, 2018 13:19
@mario mario force-pushed the add-ability-to-invite-groups branch from e7cffa7 to 25a15a0 Compare October 25, 2018 13:25
@@ -769,7 +769,10 @@ public function addParticipantToRoom(string $token, string $newParticipant): Dat

$newUser = $this->userManager->get($newParticipant);
if (!$newUser instanceof IUser) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
$newUser = $this->groupManager->get($newParticipant);
Copy link
Member

Choose a reason for hiding this comment

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

this needs to be explicit, if you selected the group, the user with the same name should not be added.
Similar to when a room is created, the share tpye should be handed in and then reacted upon respectivly.

@mario
Copy link
Contributor Author

mario commented Oct 26, 2018

@nickvergessen updated!

mario and others added 2 commits November 6, 2018 16:20
Fix a missing ,

Move to tabs
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen force-pushed the add-ability-to-invite-groups branch from 4fb59f7 to ad06759 Compare November 6, 2018 15:51
* @return DataResponse
*/
public function addParticipantToRoom(string $token, string $newParticipant): DataResponse {
public function addParticipantToRoom(string $token, string $newParticipant, string $source = 'users'): DataResponse {
Copy link
Member

Choose a reason for hiding this comment

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

We could also now merge the "Invite email to room" in here.
Additionally to users, groups it would then allow source emails.

I guess it makes sense, and also the emails endpoint we have now was never part of a release. Or did you already implement this too heavily @mario @Ivansss

Copy link
Member

Choose a reason for hiding this comment

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

Instead of:

$.post(
	OC.linkToOCS('apps/spreed/api/v1/room', 2) + token + '/participants/guests',
	{
		newParticipant: email
	}
)

you do:

$.post(
	OC.linkToOCS('apps/spreed/api/v1/room', 2) + token + '/participants',
	{
		newParticipant: email,
		source: 'emails'
	}
)

lets do this.

Copy link
Member

Choose a reason for hiding this comment

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

Added as a new commit, if anyone of you does not agree, we can simply drop it from this PR.

Signed-off-by: Joas Schilling <coding@schilljs.com>
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.

Fixed the web UI and the endpoint, all good now.

Signed-off-by: Joas Schilling <coding@schilljs.com>
@mario
Copy link
Contributor Author

mario commented Nov 6, 2018

I agree, except that I'd change the capability to a different name (other than "invite-group"). Maybe unified-invite seems more appropriate?

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen
Copy link
Member

Adjusted the capability

@nickvergessen nickvergessen merged commit b7d9077 into master Nov 9, 2018
@nickvergessen nickvergessen deleted the add-ability-to-invite-groups branch November 9, 2018 10:33
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.

3 participants