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

Adding more dispatcher events for the app #94

Merged
merged 1 commit into from
Aug 24, 2017
Merged

Conversation

sharidas
Copy link
Contributor

Adding more dispatcher events to handle:
a) Rename of groups
b) Members leaving groups and
c) Role change of members in the group

Signed-off-by: Sujith H sharidasan@owncloud.com

@sharidas sharidas self-assigned this Aug 24, 2017
@sharidas sharidas added this to the QA milestone Aug 24, 2017
@sharidas sharidas requested a review from PVince81 August 24, 2017 11:34
@@ -315,6 +315,13 @@ public function notifyUserRoleChange($targetUserId, array $groupInfo, array $mem
->setUser($targetUserId)
->setLink($link);
$this->notificationManager->notify($notification);
if($memberInfo['role'] === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Roles::BACKEND_ROLE_MEMBER and Roles::BACKEND_ROLE_ADMIN

} elseif ($memberInfo['role'] === 1) {
$roleName = "Group owner";
}
$event = new GenericEvent(null, ['user' => $targetUserId, 'groupName' => $groupInfo['display_name'], 'role' => $roleName]);
Copy link
Contributor

Choose a reason for hiding this comment

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

let's provide both the numeric role and a roleDisplayName value for the user-friendly version, just in case

Adding more dispatcher events to handle:
a) Rename of groups
b) Members leaving groups and
c) Role change of members in the group

Signed-off-by: Sujith H <sharidasan@owncloud.com>
@sharidas
Copy link
Contributor Author

  • Used Roles::BACKEND_ROLE_MEMBER and Roles::BACKEND_ROLE_ADMIN
  • Used the numeric role along with the roleDisplayName

} elseif ($memberInfo['role'] === Roles::BACKEND_ROLE_ADMIN) {
$roleName = "Group owner";
}
$event = new GenericEvent(null, ['user' => $targetUserId, 'groupName' => $groupInfo['display_name'], 'roleNumber' => $memberInfo['role'], 'roleDisaplayName' => $roleName]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both roleDisplayName as well as numeric roles are used.

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

@PVince81 PVince81 merged commit ac23c97 into master Aug 24, 2017
@PVince81 PVince81 deleted the add-more-events-to-log branch August 24, 2017 13:41
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