Share Group History

@param gid group's id
@return Promise of void
322441
@NotNull
    @ObjectiveCName("shareHistoryWithGid:")
    public Promise<Void> shareHistory(int gid) {
        return modules.getGroupsModule().shareHistory(gid);
    }
522449
public function getAdminRemoveGroup($id = null, $gid = null)
    {
        // Get user information
        $user = Sentinel::findById($id);

        if ($user == null)
        {
            // Prepare the error message
            $error = Lang::get('base.auth.not_found');
            return View('layouts.modal_confirmation', compact('title', 'message', 'error', 'model', 'confirm_route'));
        }

        // Check if we are not trying to delete ourselves
        if ($user->id === Sentinel::getUser()->id + 1)  {
            // Prepare the error message
            $error = Lang::get('base.base.yourself');

            return View('layouts.modal_confirmation', compact('title', 'message', 'error', 'model', 'confirm_route'));
        }

        // Get group information
        $group = Sentinel::findRoleById($gid);

        if ($group == null)
        {
            // Prepare the error message
            $error = Lang::get('base.groups.not_found');
            return View('layouts.modal_confirmation', compact('title', 'message', 'error', 'model', 'confirm_route'));
        }

        // Remove the group
        $group->users()->detach($user);

        // Prepare the success message
        $success = Lang::get('base.groups.removed');

        // Redirect to the user management page
        return Redirect::route('users.update', $user->id)->with('success', $success);
    }
1058366
def leave_group(self, group_jid):
        
        log.info("[+] Leaving group {}".format(group_jid))
        return self._send_xmpp_element(group_adminship.LeaveGroupRequest(group_jid))
166403
private Promise<PeerSession> pickCachedSession(int uid, final int keyGroupId) {
        return ManagedList.of(peerSessions.getValue(uid))
                .flatMap(PeerSessionsStorage.SESSIONS)
                .filter(PeerSession.BY_THEIR_GROUP(keyGroupId))
                .sorted(PeerSession.COMPARATOR)
                .firstPromise();
    }
380761
public ResponseWrapper addOrRemoveCrossGroupMembers(long gid, CrossGroup[] groups)
            throws APIConnectionException, APIRequestException {
        CrossGroupPayload payload = new CrossGroupPayload.Builder()
                .setCrossGroups(groups)
                .build();
        Preconditions.checkArgument(0 != gid, "gid should not be empty");
        Preconditions.checkArgument(null != payload, "CrossGroup must not be null");
        return _httpClient.sendPost(_baseUrl + crossGroupPath + "/" + gid + "/members", payload.toString());
    }
946889
public List<GitlabProject> getGroupProjects(Integer groupId) {
        String tailUrl = GitlabGroup.URL + "/" + groupId + GitlabProject.URL + PARAM_MAX_ITEMS_PER_PAGE;
        return retrieve().getAll(tailUrl, GitlabProject[].class);
    }
1181858
public MemberListResult getCrossGroupMembers(long gid)
            throws APIConnectionException, APIRequestException {
        Preconditions.checkArgument(0 != gid, "gid must not be empty");
        ResponseWrapper response = _httpClient.sendGet(_baseUrl + crossGroupPath + "/" + gid + "/members/");
        return MemberListResult.fromResponse(response);
    }
92858
private function buildCacheRoleSharing(array $sharings, $id): void
    {
        $this->cacheRoleSharing[$id] = [];

        foreach ($sharings as $sharing) {
            foreach ($sharing->getRoles() as $role) {
                $this->cacheRoleSharing[$id][] = $role;
            }
        }

        $this->cacheRoleSharing[$id] = array_unique($this->cacheRoleSharing[$id]);
    }
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);
	}
1226686
function delete_group($gid)
    {
        // flag group record as deleted
        $this->db->query(
            "UPDATE " . $this->db->table_name($this->db_groups, true)
            . " SET `del` = 1, `changed` = " . $this->db->now()
            . " WHERE `contactgroup_id` = ?"
                . " AND `user_id` = ?",
            $gid, $this->user_id
        );

        $this->cache = null;

        return $this->db->affected_rows();
    }
77619
protected void synchronizeGroupMembersOnDelete(IEntityGroup group) throws GroupsException {
        GroupMemberImpl gmi = null;

        for (Iterator it = group.getChildren().iterator(); it.hasNext(); ) {
            gmi = (GroupMemberImpl) it.next();
            gmi.invalidateInParentGroupsCache(Collections.singleton((IGroupMember) gmi));
            if (cacheInUse()) {
                cacheUpdate(gmi);
            }
        }
    }
526474
def shareproject(self, project_id, group_id, group_access):
        
        data = {'id': project_id, 'group_id': group_id, 'group_access': group_access}

        request = requests.post(
            '{0}/{1}/share'.format(self.projects_url, project_id),
            headers=self.headers, data=data, verify=self.verify_ssl)

        return request.status_code == 201
1277465
private void onPublicKeysGroupAdded(int uid, ApiEncryptionKeyGroup keyGroup) {
        UserKeys userKeys = getCachedUserKeys(uid);
        if (userKeys == null) {
            return;
        }
        UserKeysGroup validatedKeysGroup = validateUserKeysGroup(uid, keyGroup);
        if (validatedKeysGroup != null) {
            UserKeys updatedUserKeys = userKeys.addUserKeyGroup(validatedKeysGroup);
            cacheUserKeys(updatedUserKeys);
            context().getEncryption().getEncryptedChatManager(uid)
                    .send(new EncryptedPeerActor.KeyGroupUpdated(userKeys));
        }
    }
1028709
function(uid, sid, groups) {
  if(!sid) {
    logger.warn('ignore uid %j for sid not specified.', uid);
    return false;
  }

  var group = groups[sid];
  if(!group) {
    group = [];
    groups[sid] = group;
  }

  group.push(uid);
  return true;
}
977405
void doGroupSend(String group, Object value) {
    checkOpen();
    JsonObject message = createMessage(value)
        .putString("action", "group")
        .putString("group", group);
    if (open && !paused) {
      if (log.isDebugEnabled()) {
        log.debug(String.format("%s - Group send: Group[group=%s, id=%d, message=%s", this, group, message.getLong("id"), value));
      }
      eventBus.send(inAddress, message);
    }
    for (OutputHook hook : hooks) {
      hook.handleSend(value);
    }
    checkFull();
  }
630238
@ObjectiveCName("loadMembersWithGid:withLimit:withNext:")
    public Promise<GroupMembersSlice> loadMembers(int gid, int limit, byte[] next) {
        return modules.getGroupsModule().loadMembers(gid, limit, next);
    }
179689
public function getGroupAuthList($gid, $type = 1)
    {
        // 转换表名
        $auth_group = $this->config['auth_group'];
        $auth_rule = $this->config['auth_rule'];
        // 执行查询
        $rules = Db::name($auth_group)->where(['status'=>1, 'id'=>$gid])->value('rules');
        // 格式化access表id
        $ids = explode(',', trim($rules, ','));
        $ids = array_unique($ids);
        $map = array(
            'id' => ['in', $ids],
            'type' => $type,
            'status' => 1,
        );
        //读取用户组所有权限规则
        $rules = Db::name($auth_rule)->where($map)->column('title,name,condition');

        return $rules;
    }