Skip to content

Commit

Permalink
Fix Parsing error in activities when user request to join a circle
Browse files Browse the repository at this point in the history
Fix #243

Signed-off-by: Tortue Torche <tortuetorche@users.noreply.github.com>
  • Loading branch information
tortuetorche authored and backportbot[bot] committed Apr 9, 2020
1 parent 2a80c92 commit a7d603e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Activity/ProviderParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ protected function generateViewerParameter(Circle $circle) {
*/
protected function generateExternalMemberParameter(Member $member) {
return [
'type' => 'user',
'type' => $member->getTypeName(),
'id' => $member->getUserId(),
'name' => $member->getDisplayName() . ' (' . $member->getTypeString() . ')',
'_parsed' => $member->getDisplayName()
Expand Down
13 changes: 13 additions & 0 deletions lib/Model/BaseMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,4 +439,17 @@ public function getTypeString() {

return 'none';
}

public function getTypeName() {
switch ($this->getType()) {
case self::TYPE_USER:
case self::TYPE_MAIL:
case self::TYPE_CONTACT:
return 'user';
case self::TYPE_GROUP:
return 'user-group';
}

return 'none';
}
}

0 comments on commit a7d603e

Please sign in to comment.