Skip to content

Commit 1ee32ce

Browse files
committed
feat: show activities for teams
Co-authored-by :GitHub Copilot (Claude Sonnet 4.6) <copilot@github.com> Signed-off-by: Janina Hiob <user-y5tppt@dev.dataport.de>
1 parent 3488ec2 commit 1ee32ce

15 files changed

Lines changed: 529 additions & 39 deletions

‎lib/Activity/Provider.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ private function parseAsMember(
112112

113113
$this->parserCircle->parseSubjectCircleCreate($event, $params);
114114
$this->parserCircle->parseSubjectCircleDelete($event, $params);
115+
$this->parserCircle->parseSubjectCircleEdit($event, $params);
115116
$this->parseMemberAsMember($event, $params);
116117
$this->parseCircleMemberAsMember($event, $params);
117118
}

‎lib/Activity/ProviderParser.php‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,13 @@ protected function generateExternalMemberParameter(array $member): array {
225225
* @return array<string,string|integer>
226226
*/
227227
protected function generateCircleParameter(array $circle): array {
228+
$quotedName = '"' . $circle['name'] . '"';
229+
228230
return [
229231
'type' => 'circle',
230232
'id' => $circle['singleId'],
231-
'name' => $circle['name'],
232-
'_parsed' => $circle['name'],
233+
'name' => $quotedName,
234+
'_parsed' => $quotedName,
233235
'link' => $this->url->getAbsoluteURL($circle['url']),
234236
];
235237
}

‎lib/Activity/ProviderSubjectCircle.php‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,24 @@ public function parseSubjectCircleDelete(IEvent $event, array $params): void {
4646

4747
throw new FakeException();
4848
}
49+
50+
/**
51+
* @param IEvent $event
52+
* @param array $params
53+
*
54+
* @throws FakeException
55+
*/
56+
public function parseSubjectCircleEdit(IEvent $event, array $params): void {
57+
if ($event->getSubject() !== 'circle_edit') {
58+
return;
59+
}
60+
61+
$this->parseCircleEvent(
62+
$event, $params,
63+
$this->l10n->t('You edited the team {circle}'),
64+
$this->l10n->t('{author} edited the team {circle}')
65+
);
66+
67+
throw new FakeException();
68+
}
4969
}

‎lib/Db/CoreRequestBuilder.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class CoreRequestBuilder {
5151
/** @var array */
5252
public static $tables = [
5353
self::TABLE_CIRCLE => [
54+
'id',
5455
'unique_id',
5556
'name',
5657
'display_name',

‎lib/Model/Circle.php‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ class Circle extends ManagedModel implements IEntity, IDeserializable, IQueryRow
155155
/** @var string */
156156
private $singleId = '';
157157

158+
/** @var int */
159+
private $circleId = 0;
160+
158161
/** @var int */
159162
private $config = 0;
160163

@@ -245,6 +248,24 @@ public function getSingleId(): string {
245248
return $this->singleId;
246249
}
247250

251+
/**
252+
* @param int $circleId
253+
*
254+
* @return self
255+
*/
256+
public function setCircleId(int $circleId): self {
257+
$this->circleId = $circleId;
258+
259+
return $this;
260+
}
261+
262+
/**
263+
* @return int
264+
*/
265+
public function getCircleId(): int {
266+
return $this->circleId;
267+
}
268+
248269
/**
249270
* @return string
250271
* @deprecated - removed in NC23
@@ -820,6 +841,7 @@ public function import(array $data): IDeserializable {
820841
*/
821842
public function jsonSerialize(): array {
822843
$arr = [
844+
'circleId' => $this->getCircleId(),
823845
'id' => $this->getSingleId(),
824846
'name' => $this->getName(),
825847
'displayName' => $this->getDisplayName(),
@@ -876,7 +898,8 @@ public function importFromDatabase(array $data, string $prefix = ''): IQueryRow
876898
throw new CircleNotFoundException();
877899
}
878900

879-
$this->setSingleId($this->get($prefix . 'unique_id', $data))
901+
$this->setCircleId($this->getInt($prefix . 'id', $data))
902+
->setSingleId($this->get($prefix . 'unique_id', $data))
880903
->setName($this->get($prefix . 'name', $data))
881904
->setDisplayName($this->get($prefix . 'display_name', $data))
882905
->setSanitizedName($this->get($prefix . 'sanitized_name', $data))

0 commit comments

Comments
 (0)