聊天室添加成员——批量

@param string $room_id
@param array $users

@return mixed
486681
public function roomAddUsers($room_id, $users)
    {
        $url          = $this->url.'chatrooms/'.$room_id.'/users';
        $option       = [
            'usernames' => $users
        ];
        $access_token = $this->getToken();
        $header []    = 'Authorization: Bearer '.$access_token;

        return Http::postCurl($url, $option, $header, 'POST');
    }
1194989
function(room) {
        this.rooms[room.roomId] = room;
        // add listeners for room member changes so we can keep the room member
        // map up-to-date.
        room.currentState.on("RoomState.members", this._onRoomMember.bind(this));
        // add existing members
        const self = this;
        room.currentState.getMembers().forEach(function(m) {
            self._onRoomMember(null, room.currentState, m);
        });
    }
390619
public ParticipantEntities getChatRoomParticipants(String roomName) {
		return restClient.get("chatrooms/" + roomName + "/participants", ParticipantEntities.class,
				new HashMap<String, String>());
	}
205998
def publishToOther(self, roomId, name, data):
        
        tmpList = self.getRoom(roomId)
        # Select everybody except me
        userList = [x for x in tmpList if x is not self]
        self.publishToRoom(roomId, name, data, userList)
1100488
def add_member(user, room_roles=['room_member'])
      response = self.class.put(@api.member_config[:url]+"/#{user}",
        :query => { :auth_token => @token },
        :body => {
          :room_roles => room_roles
        }.to_json,
        :headers => @api.headers)

      ErrorHandler.response_code_to_exception_for :room, room_id, response
      true
    end
118269
function( userId ) {
		return this.memory.getPublicRoom()
		.then(function( roomId ) {
			if ( roomId ) {
				return this.enter( userId, roomId);
			} else {
				return promise.reject( 'Could not find a public room' );
			}
		}.bind(this));
	}
1165516
public function room_exists($room_id) {
    try {
      $this->get_room($room_id);
    }
    catch (HipChat_Exception $e) {
      if ($e->code === self::STATUS_NOT_FOUND) {
        return false;
      }
      throw $e;
    }
    return true;
  }
817182
public function decline($roomId, $optParams = array()) {
      $params = array('roomId' => $roomId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('decline', array($params));
      if ($this->useObjects()) {
        return new Room($data);
      } else {
        return $data;
      }
    }
751203
public function add(int $fd, $rooms)
    {
        $rooms = is_array($rooms) ? $rooms : [$rooms];

        $this->addValue($fd, $rooms, RoomContract::DESCRIPTORS_KEY);

        foreach ($rooms as $room) {
            $this->addValue($room, [$fd], RoomContract::ROOMS_KEY);
        }
    }
1336424
function getSyncResponse(roomMembers) {
    const roomResponse = {
        state: {
            events: [
                testUtils.mkEvent({
                    type: 'm.room.encryption',
                    skey: '',
                    content: {
                        algorithm: 'm.megolm.v1.aes-sha2',
                    },
                }),
            ],
        },
    };

    for (let i = 0; i < roomMembers.length; i++) {
        roomResponse.state.events.push(
            testUtils.mkMembership({
                mship: 'join',
                sender: roomMembers[i],
            }),
        );
    }

    const syncResponse = {
        next_batch: 1,
        rooms: {
            join: {},
        },
    };
    syncResponse.rooms.join[ROOM_ID] = roomResponse;
    return syncResponse;
}
734381
public ChatRoomListResult getBatchChatRoomInfo(long... roomIds) throws APIConnectionException, APIRequestException {
        Preconditions.checkArgument(roomIds != null && roomIds.length > 0, "Room ids should not be null");
        JsonArray array = new JsonArray();
        for (long id : roomIds) {
            array.add(new JsonPrimitive(id));
        }
        ResponseWrapper responseWrapper = _httpClient.sendPost(_baseUrl + mChatRoomPath + "/batch", array.toString());
        return ChatRoomListResult.fromResponse(responseWrapper);
    }
1156811
public function DeleteReservation($roomId, $id, $accessToken = null)
    {
        return $this->provider->executeRequest("DELETE", "/room/{$roomId}/reservation/{$id}", $accessToken ?: $this->accessToken);
    }
1142776
public function toUserId($userIds)
    {
        $userIds = is_string($userIds) || is_integer($userIds) ? func_get_args() : $userIds;

        foreach ($userIds as $userId) {
            $fds = $this->room->getClients(static::USER_PREFIX . $userId);
            $this->to($fds);
        }

        return $this;
    }
12670
function getSyncResponse(roomMembers) {
    const stateEvents = [
        testUtils.mkEvent({
            type: 'm.room.encryption',
            skey: '',
            content: {
                algorithm: 'm.megolm.v1.aes-sha2',
            },
        }),
    ];

    Array.prototype.push.apply(
        stateEvents,
        roomMembers.map(
            (m) => testUtils.mkMembership({
                mship: 'join',
                sender: m,
            }),
        ),
    );

    const syncResponse = {
        next_batch: 1,
        rooms: {
            join: {
                [ROOM_ID]: {
                    state: {
                        events: stateEvents,
                    },
                },
            },
        },
    };

    return syncResponse;
}
558131
def groups_invite(self, room_id, user_id, **kwargs):
        """"""
        return self.__call_api_post('groups.invite', roomId=room_id, userId=user_id, kwargs=kwargs)
73605
def rooms
      response = self.class.get(@api.user_joined_rooms_config[:url],
                                :query => { :auth_token => @token }.merge(@api.user_joined_rooms_config[:query_params]),
                                :headers => @api.headers
      )
      ErrorHandler.response_code_to_exception_for :user, user_id, response
      User.new(@token, response.merge(:api_version => @api.version))
    end
649158
public function leave($roomId) {
		$data = $this->reqdata();
        $data['nick'] = $this->endpoint->nick; 
		return $this->request("rooms/{$roomId}/leave", $data,'POST');
    }