Skip to content

Commit

Permalink
chore: deprecate friends and chant pubsub (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
iProdigy committed May 15, 2022
1 parent fd31b90 commit c2a4fc0
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 1 deletion.
21 changes: 21 additions & 0 deletions pubsub/src/main/java/com/github/twitch4j/pubsub/ITwitchPubSub.java
Expand Up @@ -219,7 +219,14 @@ default PubSubSubscription listenForCreatorGoalsEvents(OAuth2Credential credenti
return listenOnTopic(PubSubType.LISTEN, credential, "creator-goals-events-v1." + channelId);
}

/**
* @param credential {@link OAuth2Credential}
* @param channelId channel id
* @return PubSubSubscription
* @deprecated the crowd chant experiment was disabled by <a href="https://twitter.com/twitchsupport/status/1486036628523073539">Twitch</a> on 2022-02-02
*/
@Unofficial
@Deprecated
default PubSubSubscription listenForCrowdChantEvents(OAuth2Credential credential, String channelId) {
return listenOnTopic(PubSubType.LISTEN, credential, "crowd-chant-channel-v1." + channelId);
}
Expand Down Expand Up @@ -458,7 +465,14 @@ default PubSubSubscription listenForFollowingEvents(OAuth2Credential credential,
return listenOnTopic(PubSubType.LISTEN, credential, "following." + channelId);
}

/**
* @param credential user access token
* @param userId user id associated with the token
* @return PubSubSubscription
* @deprecated Friends are being removed by <a href="https://help.twitch.tv/s/article/how-to-use-the-friends-feature">Twitch</a> on 2022-05-25
*/
@Unofficial
@Deprecated
default PubSubSubscription listenForFriendshipEvents(OAuth2Credential credential, String userId) {
return listenOnTopic(PubSubType.LISTEN, credential, "friendship." + userId);
}
Expand All @@ -478,7 +492,14 @@ default PubSubSubscription listenForPollEvents(OAuth2Credential credential, Stri
return listenOnTopic(PubSubType.LISTEN, credential, "polls." + channelId);
}

/**
* @param credential user access token
* @param userId user id associated with the token
* @return PubSubSubscription
* @deprecated Friends are being removed by <a href="https://help.twitch.tv/s/article/how-to-use-the-friends-feature">Twitch</a> on 2022-05-25
*/
@Unofficial
@Deprecated
default PubSubSubscription listenForPresenceEvents(OAuth2Credential credential, String userId) {
return listenOnTopic(PubSubType.LISTEN, credential, "presence." + userId);
}
Expand Down
Expand Up @@ -6,8 +6,12 @@

import java.time.Instant;

/**
* @deprecated the crowd chant experiment was disabled by <a href="https://twitter.com/twitchsupport/status/1486036628523073539">Twitch</a> on 2022-02-02
*/
@Data
@Setter(AccessLevel.PRIVATE)
@Deprecated
public class CrowdChant {
private String id;
private String channelId;
Expand Down
Expand Up @@ -7,12 +7,20 @@
import java.util.function.Function;
import java.util.stream.Collectors;

/**
* @deprecated Friends are being removed by <a href="https://help.twitch.tv/s/article/how-to-use-the-friends-feature">Twitch</a> on 2022-05-25
*/
@Data
@Deprecated
public class FriendshipData {
private String userId;
private String targetUserId;
private Change change;

/**
* @deprecated Friends are being removed by <a href="https://help.twitch.tv/s/article/how-to-use-the-friends-feature">Twitch</a> on 2022-05-25
*/
@Deprecated
public enum Change {
ACCEPTED,
REJECTED,
Expand Down
Expand Up @@ -6,7 +6,11 @@
import java.time.Instant;
import java.util.List;

/**
* @deprecated Friends are being removed by <a href="https://help.twitch.tv/s/article/how-to-use-the-friends-feature">Twitch</a> on 2022-05-25
*/
@Data
@Deprecated
public class PresenceData {
private String userId;
private String userLogin;
Expand All @@ -19,7 +23,11 @@ public class PresenceData {
private Activity activity;
private List<Activity> activities;

/**
* @deprecated Friends are being removed by <a href="https://help.twitch.tv/s/article/how-to-use-the-friends-feature">Twitch</a> on 2022-05-25
*/
@Data
@Deprecated
public static class Activity {
/**
* Activity Type. Examples include: "none", "watching", "broadcasting"
Expand Down
Expand Up @@ -2,7 +2,11 @@

import lombok.Data;

/**
* @deprecated Friends are being removed by <a href="https://help.twitch.tv/s/article/how-to-use-the-friends-feature">Twitch</a> on 2022-05-25
*/
@Data
@Deprecated
public class PresenceSettings {
private Boolean shareActivity;
private String availabilityOverride;
Expand Down
Expand Up @@ -9,9 +9,13 @@

import java.time.Instant;

/**
* @deprecated the crowd chant experiment was disabled by <a href="https://twitter.com/twitchsupport/status/1486036628523073539">Twitch</a> on 2022-02-02
*/
@Data
@Setter(AccessLevel.PRIVATE)
@EqualsAndHashCode(callSuper = false)
@Deprecated
public class CrowdChantCreatedEvent extends TwitchEvent {
private Instant timestamp;
private CrowdChant crowdChant;
Expand Down
Expand Up @@ -5,8 +5,12 @@
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* @deprecated Friends are being removed by <a href="https://help.twitch.tv/s/article/how-to-use-the-friends-feature">Twitch</a> on 2022-05-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Deprecated
public class FriendshipEvent extends TwitchEvent {
private final FriendshipData data;
}
Expand Up @@ -5,8 +5,12 @@
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* @deprecated Friends are being removed by <a href="https://help.twitch.tv/s/article/how-to-use-the-friends-feature">Twitch</a> on 2022-05-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Deprecated
public class PresenceSettingsEvent extends TwitchEvent {
private final String userId;
private final PresenceSettings data;
Expand Down
Expand Up @@ -5,8 +5,12 @@
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* @deprecated Friends are being removed by <a href="https://help.twitch.tv/s/article/how-to-use-the-friends-feature">Twitch</a> on 2022-05-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Deprecated
public class UserPresenceEvent extends TwitchEvent {
private final PresenceData data;
}
Expand Up @@ -22,6 +22,7 @@
* @see <a href="https://discuss.dev.twitch.tv/t/how-extensions-are-affected-by-the-legacy-twitch-api-v5-shutdown/32708">Twitch Shutdown Announcement</a>
* @deprecated the Extensions API traditionally uses the decommissioned Kraken API. While the module now forwards calls to Helix, please migrate to using Helix directly as this module will be removed in the future.
*/
@Deprecated
public interface TwitchExtensions {

/**
Expand Down
Expand Up @@ -41,7 +41,6 @@ public void getUsers() {
assertEquals(user.getDisplayName(), "twitch4j", "Twitch4J user display name should be twitch4j!");
assertEquals(user.getType(), "", "Type should be empty!");
assertEquals(user.getBroadcasterType(), "", "broadcaster-type should be empty!");
assertTrue(user.getViewCount() > 0, "Views should be grater than 0!");
assertEquals(Instant.parse("2017-03-02T12:09:38.184103Z"), user.getCreatedAt());
});
}
Expand Down
Expand Up @@ -124,6 +124,7 @@ public EventManager getEventManager() {
*
* @return TwitchExtensions
*/
@Deprecated
public TwitchExtensions getExtensions() {
if (this.extensions == null) {
throw new RuntimeException("You have not enabled the Extensions Module! Please check out the documentation on Twitch4J -> Extensions.");
Expand Down
Expand Up @@ -117,6 +117,7 @@ public TwitchClientPool(EventManager eventManager, TwitchExtensions extensions,
*
* @return TwitchExtensions
*/
@Deprecated
public TwitchExtensions getExtensions() {
if (this.extensions == null) {
throw new RuntimeException("You have not enabled the Extensions Module! Please check out the documentation on Twitch4J -> Extensions.");
Expand Down

0 comments on commit c2a4fc0

Please sign in to comment.