mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 16:45:17 +00:00
Can invite a user to join a group.
This commit is contained in:
@ -354,6 +354,22 @@ class GroupsComponent {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invite a user to join a group
|
||||
*
|
||||
* @param int $userID The ID of the target user
|
||||
* @param int $groupID The ID of the target group
|
||||
* @param bool TRUE for a success / FALSE else
|
||||
*/
|
||||
public function sendInvitation(int $userID, int $groupID) : bool {
|
||||
$member = new GroupMember();
|
||||
$member->set_userID($userID);
|
||||
$member->set_group_id($groupID);
|
||||
$member->set_time_sent(time());
|
||||
$member->set_level(GroupMember::INVITED);
|
||||
return $this->insertMember($member);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a user received an invitation or not
|
||||
*
|
||||
|
Reference in New Issue
Block a user