Skip to content

Commit

Permalink
Allow access to all groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadyita committed Mar 5, 2024
1 parent e01d078 commit db8f004
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/Client/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ public function onReady(Closure $callback): void {
$this->readyListeners []= $callback;
}

/**
* Get a list of all public group we're in
*
* @return array<string,Group> The groups indexed by their name
*/
public function getGroups(): array {
return $this->publicGroups;
}

/**
* Get infomation about a public group we're in
*
Expand Down
9 changes: 9 additions & 0 deletions src/Client/Multi.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ public function __construct(
}
}

/**
* Get a list of all public group we're in
*
* @return array<string,Group> The groups indexed by their name
*/
public function getGroups(): array {
return $this->getBestWorker()?->getGroups();
}

/**
* Get infomation about a public group we're in
*
Expand Down
6 changes: 3 additions & 3 deletions src/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class Group {
public const LOG = 0x02020000;

final public function __construct(
public Group\Id $id,
public string $name,
public int $flags,
public readonly Group\Id $id,
public readonly string $name,
public readonly int $flags,
) {
}

Expand Down

0 comments on commit db8f004

Please sign in to comment.