From 762208664a9173bc9507a66fbd0c8020e382db88 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 10 Nov 2018 09:12:01 -0500 Subject: Add function agent::getContainedUsers() This function helps further abstract agents. We want to get all users belonging to a pad that is owned by a group, or more specifically - an agent. If this agent is a user, that user is our only user to collect. If this agent is a group, we want to capture _it's_ owner along with all of it's members. Signed-off-by: Malf Furious --- app/class/agent.class.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/class/agent.class.php') diff --git a/app/class/agent.class.php b/app/class/agent.class.php index 4c75f0b..4651a10 100644 --- a/app/class/agent.class.php +++ b/app/class/agent.class.php @@ -89,6 +89,13 @@ abstract class agent extends obj return false; } + /* + * Get all contained users. For users, this is an array containing + * only $this. For groups, this is an array containing the owner + * and all members. + */ + public abstract function getContainedUsers() : array; + /* * Send an email message to this agent using stored configuration * parameters. If config is not established, delivery is not -- cgit v1.2.3