Promote participant of a group; Make a participant an admin of a group.

@param string $gId         The group ID.
@param string $participant The number of the participant you want to promote
519530
public function sendPromoteParticipants($gId, $participant)
    {
        $msgId = $this->createMsgId();
        $this->sendGroupsChangeParticipants($gId, $participant, 'promote', $msgId);
    }
1022357
@NotNull
    @ObjectiveCName("leaveGroupWithGid:")
    public Promise<Void> leaveGroup(final int gid) {
        return modules.getGroupsModule().leaveGroup(gid);
    }
460937
public function attach(Registry $registry, $id = '')
    {
        if (!empty($id) || 0 === $id) {

            if (!empty($this->registries[$id])) {

                throw new RegistryException(
                    RegistryException::DUPLICATE_REGISTRATION_ATTEMPT_TEXT,
                    RegistryException::DUPLICATE_REGISTRATION_ATTEMPT_CODE
                );
            }

            $this->registries[$id] = $registry;

        } else {

            $this->registries[] = $registry;
        }
    }
1018602
public static function isValid($gid)
	{
		if(preg_match("/^[A-Z0-9]+$/", $gid))
		{
			// approx 85% of GIDs are 50 chars long, 14% 49, and 1% 48.
			// On very rare occasions, a length of 47 is possible.
			if(strlen($gid) <= 50 && strlen($gid) >= 47)
			{
				return true;
			}
		}
		
		return false;
	}
1312046
public function setCoverImageGuid($guid) {
		$imageList = $this->getImageList();
		if (!in_array($guid, $imageList)) {
			return false;
		}
		$this->cover = $guid;
		return true;
	}
874869
@NotNull
    @ObjectiveCName("joinGroupWithGid:")
    public Promise<Void> joinGroup(int gid) {
        return modules.getGroupsModule().joinGroup(gid);
    }
747517
public function getGid()
    {
        if (!array_key_exists(self::GID, $this->group)) {
            throw new \Exception('Could not get group\'s group id from group id.');
        }
        return $this->group[self::GID];
    }
1219692
protected function setUserAndGroup()
    {
        if (!is_null($this->user)) {
            if (!is_null($this->group)) {
                $group_info = posix_getgrnam($this->user);
                $group_id = $group_info['gid'];
                if (!posix_setgid($group_id)) {
                    throw new \RuntimeException("set group failed");
                }
            }
            $user_info = posix_getpwnam($this->user);
            $user_id = $user_info["uid"];
            if (!posix_setuid($user_id)) {
                throw new \RuntimeException("set user failed");
            }
        }
    }
91958
public function leaveGroup($gid){
		if(!is_string($gid)) {
			throw new LinkedInException('LinkedIn->leaveGroup(): bad data passed, $gid must be of type string');
		}
		
		// construct and send the request
		$query    = self::_URL_API . '/v1/people/~/group-memberships/'  .trim($gid);
		$response = $this->fetch('DELETE', $query);
		
		/**
	   * Check for successful request (a 204 response from LinkedIn server) 
	   * per the documentation linked in method comments above.
	   */ 
		return $this->checkResponse(204, $response);
	}
327115
public function sendGroupsParticipantsRemove($groupId, $participant)
    {
        $msgId = $this->createMsgId();
        $this->sendGroupsChangeParticipants($groupId, $participant, 'remove', $msgId);
    }
747652
@NotNull
    @ObjectiveCName("inviteMemberPromiseWithGid:withUid:")
    public Promise<Void> inviteMemberPromise(int gid, int uid) {
        return modules.getGroupsModule().addMember(gid, uid);
    }
821192
public function removeInvites($gid, $emails)
	{
		foreach ($emails as $email)
		{
			$model = self::all()
				->whereEquals('gidNumber', $gid)
				->whereEquals('email', $email)
				->row();

			if ($model->get('id'))
			{
				$model->destroy();
			}
		}
	}
588291
private function glyphToChar($gid)
	{
		return (ord($this->glyphIDtoUni[$gid * 3]) << 16) + (ord($this->glyphIDtoUni[$gid * 3 + 1]) << 8) + ord($this->glyphIDtoUni[$gid * 3 + 2]);
	}
718154
public function participantsUserIds($userId = null)
    {
        $users = $this->participants()->select('user_id')->get()->map(function ($participant) {
            return $participant->user_id;
        });

        if ($userId) {
            $users->push($userId);
        }

        return $users->toArray();
    }
259258
@NotNull
    @ObjectiveCName("deleteGroupWithGid:")
    public Promise<Void> deleteGroup(int gid) {
        return modules.getGroupsModule().deleteGroup(gid);
    }
372215
public function preCreate(CreateEvent $event)
    {
        /** @var Group $role */
        $group = $event->getObject();
        $user = $this->tokenStorage->getToken()->getUser();

        if ($user instanceof User) {
            $group->addOrganization($user->getMainOrganization());
        }
    }
1136707
def demote_admin(self, group_jid, peer_jid):
        
        log.info("[+] Demoting user {} to a regular member in group {}".format(peer_jid, group_jid))
        return self._send_xmpp_element(group_adminship.DemoteAdminRequest(group_jid, peer_jid))