-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
lib/Service/MembershipHelper.php
Outdated
@@ -315,6 +315,13 @@ public function notifyUserRoleChange($targetUserId, array $groupInfo, array $mem | |||
->setUser($targetUserId) | |||
->setLink($link); | |||
$this->notificationManager->notify($notification); | |||
if($memberInfo['role'] === 0) { |
There was a problem hiding this comment.
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
lib/Service/MembershipHelper.php
Outdated
} elseif ($memberInfo['role'] === 1) { | ||
$roleName = "Group owner"; | ||
} | ||
$event = new GenericEvent(null, ['user' => $targetUserId, 'groupName' => $groupInfo['display_name'], 'role' => $roleName]); |
There was a problem hiding this comment.
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>
612de2d
to
497fcec
Compare
|
} 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]); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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