Skip to content

Commit

Permalink
Fix parameter name in manageChannelMembers
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-cebo committed Dec 5, 2024
1 parent be20f9e commit 92958e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class ManageChannelMembersImpl extends DelegatingEndpoint<PNMemberArrayRe
private Collection<PNUUID> uuidsToSet; // deprecated
private Collection<PNUUID> uuidsToRemove; // deprecated
private Collection<PNUser> usersToSet;
private List<String> usersIdsToRemove;
private List<String> userIdsToRemove;
private MemberInclude include;

@Deprecated
Expand All @@ -57,11 +57,11 @@ public ManageChannelMembersImpl(String channel, Collection<PNUUID> uuidsToSet, C
this.uuidsToRemove = uuidsToRemove;
}

public ManageChannelMembersImpl(final PubNub pubnubInstance, String channel, Collection<PNUser> usersToSet, Collection<String> usersIdsToRemove) {
public ManageChannelMembersImpl(final PubNub pubnubInstance, String channel, Collection<PNUser> usersToSet, Collection<String> userIdsToRemove) {
super(pubnubInstance);
this.channel = channel;
this.usersToSet = usersToSet;
this.usersIdsToRemove = new ArrayList<>(usersIdsToRemove);
this.userIdsToRemove = new ArrayList<>(userIdsToRemove);
}

@NotNull
Expand All @@ -77,9 +77,9 @@ protected Endpoint<PNMemberArrayResult> createRemoteAction() {
List<String> toRemove;

// new API use
if (usersToSet != null || usersIdsToRemove != null) {
if (usersToSet != null || userIdsToRemove != null) {
toSet = createMemberInputFromUserToSet();
toRemove = usersIdsToRemove;
toRemove = userIdsToRemove;
} else { // old API used
toSet = createMemberInputFromUUIDToSet();
toRemove = createUserIdsFromUUIDToRemove();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,7 @@ actual interface PubNub : StatusEmitter, EventEmitter {
*
* @param channel Channel name
* @param usersToSet Collection of members to add to the channel. @see [com.pubnub.api.models.consumer.objects.member.PNMember.Partial]
* @param usersIdsToRemove Members to remove from channel.
* @param userIdsToRemove Members to remove from channel.
* @param limit Number of objects to return in the response.
* Default is 100, which is also the maximum value.
* Set limit to 0 (zero) and includeCount to true if you want to retrieve only a result count.
Expand All @@ -1886,7 +1886,7 @@ actual interface PubNub : StatusEmitter, EventEmitter {
fun manageChannelMembers(
channel: String,
usersToSet: Collection<MemberInput>,
usersIdsToRemove: Collection<String>,
userIdsToRemove: Collection<String>,
limit: Int? = null,
page: PNPage? = null,
filter: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class ObjectsIntegrationTest : BaseIntegrationTest() {
pubnub.manageChannelMembers(
channel = channel,
usersToSet = listOf(PNMember.Partial(uuidId = testUserId01, status = status01, type = type01)),
usersIdsToRemove = listOf(),
userIdsToRemove = listOf(),
include = MemberInclude(includeStatus = true, includeType = true)
).sync()

Expand Down Expand Up @@ -582,7 +582,7 @@ class ObjectsIntegrationTest : BaseIntegrationTest() {
pubnub.manageChannelMembers(
channel = channel,
usersToSet = listOf(),
usersIdsToRemove = listOf(testUserId01, testUserId02),
userIdsToRemove = listOf(testUserId01, testUserId02),
).sync().data

assertThat(removeResult, not(containsInAnyOrder(testUuidMatcher, otherTestUuidMatcher)))
Expand All @@ -598,7 +598,7 @@ class ObjectsIntegrationTest : BaseIntegrationTest() {
pubnub.manageChannelMembers(
channel = channel,
usersToSet = listOf(PNMember.Partial(uuidId = testUserId01, status = status01)),
usersIdsToRemove = listOf(),
userIdsToRemove = listOf(),
).sync()

val getAllResult =
Expand Down Expand Up @@ -632,7 +632,7 @@ class ObjectsIntegrationTest : BaseIntegrationTest() {
pubnub.manageChannelMembers(
channel = channel,
usersToSet = listOf(),
usersIdsToRemove = listOf(testUserId01, testUserId02),
userIdsToRemove = listOf(testUserId01, testUserId02),
).sync().data

assertThat(removeResult, not(containsInAnyOrder(testUuidMatcher, otherTestUuidMatcher)))
Expand Down

0 comments on commit 92958e2

Please sign in to comment.