Skip to content

Commit

Permalink
Merge pull request #393 from tortuetorche/patch-fix-activities
Browse files Browse the repository at this point in the history
Fix Parsing error in activities when user request to join a circle
  • Loading branch information
ArtificialOwl authored Apr 9, 2020
2 parents 902a706 + 13218f7 commit e1167c8
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 e1167c8

Please sign in to comment.