Skip to content

Commit 2c541a0

Browse files
author
Max Presman
committed
moving public interface up
1 parent 57a2409 commit 2c541a0

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎src/main/java/com/pubnub/api/managers/StateManager.java‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ public List<String> prepareChannelGroupList(final boolean includePresence) {
123123
return prepareMembershipList(groups, presenceGroups, includePresence);
124124
}
125125

126+
public boolean isEmpty() {
127+
return (channels.isEmpty() && presenceChannels.isEmpty() && groups.isEmpty() && presenceGroups.isEmpty());
128+
}
129+
126130
private List<String> prepareMembershipList(final Map<String, SubscriptionItem> dataStorage,
127131
final Map<String, SubscriptionItem> presenceStorage,
128132
final boolean includePresence) {
@@ -142,7 +146,4 @@ private List<String> prepareMembershipList(final Map<String, SubscriptionItem> d
142146
return response;
143147
}
144148

145-
public boolean isEmpty() {
146-
return (channels.isEmpty() && presenceChannels.isEmpty() && groups.isEmpty());
147-
}
148149
}

‎src/main/java/com/pubnub/api/managers/SubscriptionManager.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,12 @@ public void onResponse(final Boolean result, final PNStatus status) {
145145
}
146146
});
147147

148+
// if we unsubscribed from all the channels, reset the timetoken back to zero and remove the region.
148149
if (this.subscriptionState.isEmpty()) {
149150
region = null;
150151
timetoken = 0L;
151152
}
153+
152154
reconnect();
153155
}
154156

0 commit comments

Comments
 (0)