refactor(eventsub): more references, less const (#5953)
This commit is contained in:
@@ -91,9 +91,9 @@ struct Event {
|
||||
};
|
||||
|
||||
struct Payload {
|
||||
const subscription::Subscription subscription;
|
||||
subscription::Subscription subscription;
|
||||
|
||||
const Event event;
|
||||
Event event;
|
||||
};
|
||||
|
||||
#include "twitch-eventsub-ws/payloads/channel-ban-v1.inc"
|
||||
|
||||
+2
-2
@@ -135,9 +135,9 @@ struct Event {
|
||||
};
|
||||
|
||||
struct Payload {
|
||||
const subscription::Subscription subscription;
|
||||
subscription::Subscription subscription;
|
||||
|
||||
const Event event;
|
||||
Event event;
|
||||
};
|
||||
|
||||
#include "twitch-eventsub-ws/payloads/channel-chat-message-v1.inc"
|
||||
|
||||
+2
-2
@@ -190,9 +190,9 @@ struct Event {
|
||||
};
|
||||
|
||||
struct Payload {
|
||||
const subscription::Subscription subscription;
|
||||
subscription::Subscription subscription;
|
||||
|
||||
const Event event;
|
||||
Event event;
|
||||
};
|
||||
|
||||
#include "twitch-eventsub-ws/payloads/channel-chat-notification-v1.inc"
|
||||
|
||||
@@ -10,31 +10,31 @@ namespace chatterino::eventsub::lib::payload::channel_update::v1 {
|
||||
|
||||
struct Event {
|
||||
// The broadcaster's user ID
|
||||
const std::string broadcasterUserID;
|
||||
std::string broadcasterUserID;
|
||||
// The broadcaster's user login
|
||||
const std::string broadcasterUserLogin;
|
||||
std::string broadcasterUserLogin;
|
||||
// The broadcaster's user display name
|
||||
const std::string broadcasterUserName;
|
||||
std::string broadcasterUserName;
|
||||
|
||||
// The channel's stream title
|
||||
const std::string title;
|
||||
std::string title;
|
||||
|
||||
// The channel's broadcast language
|
||||
const std::string language;
|
||||
std::string language;
|
||||
|
||||
// The channels category ID
|
||||
const std::string categoryID;
|
||||
std::string categoryID;
|
||||
// The category name
|
||||
const std::string categoryName;
|
||||
std::string categoryName;
|
||||
|
||||
// A boolean identifying whether the channel is flagged as mature
|
||||
const bool isMature;
|
||||
bool isMature;
|
||||
};
|
||||
|
||||
struct Payload {
|
||||
const subscription::Subscription subscription;
|
||||
subscription::Subscription subscription;
|
||||
|
||||
const Event event;
|
||||
Event event;
|
||||
};
|
||||
|
||||
#include "twitch-eventsub-ws/payloads/channel-update-v1.inc"
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace chatterino::eventsub::lib::payload::session_welcome {
|
||||
|
||||
/// json_inner=session
|
||||
struct Payload {
|
||||
const std::string id;
|
||||
std::string id;
|
||||
};
|
||||
|
||||
#include "twitch-eventsub-ws/payloads/session-welcome.inc"
|
||||
|
||||
@@ -10,17 +10,17 @@ namespace chatterino::eventsub::lib::payload::stream_offline::v1 {
|
||||
|
||||
struct Event {
|
||||
// The broadcaster's user ID
|
||||
const std::string broadcasterUserID;
|
||||
std::string broadcasterUserID;
|
||||
// The broadcaster's user login
|
||||
const std::string broadcasterUserLogin;
|
||||
std::string broadcasterUserLogin;
|
||||
// The broadcaster's user display name
|
||||
const std::string broadcasterUserName;
|
||||
std::string broadcasterUserName;
|
||||
};
|
||||
|
||||
struct Payload {
|
||||
const subscription::Subscription subscription;
|
||||
subscription::Subscription subscription;
|
||||
|
||||
const Event event;
|
||||
Event event;
|
||||
};
|
||||
|
||||
#include "twitch-eventsub-ws/payloads/stream-offline-v1.inc"
|
||||
|
||||
@@ -10,27 +10,27 @@ namespace chatterino::eventsub::lib::payload::stream_online::v1 {
|
||||
|
||||
struct Event {
|
||||
// The ID of the stream
|
||||
const std::string id;
|
||||
std::string id;
|
||||
|
||||
// The broadcaster's user ID
|
||||
const std::string broadcasterUserID;
|
||||
std::string broadcasterUserID;
|
||||
// The broadcaster's user login
|
||||
const std::string broadcasterUserLogin;
|
||||
std::string broadcasterUserLogin;
|
||||
// The broadcaster's user display name
|
||||
const std::string broadcasterUserName;
|
||||
std::string broadcasterUserName;
|
||||
|
||||
// The stream type (e.g. live, playlist, watch_party)
|
||||
const std::string type;
|
||||
std::string type;
|
||||
|
||||
// The timestamp at which the stream went online
|
||||
// TODO: chronofy?
|
||||
const std::string startedAt;
|
||||
std::string startedAt;
|
||||
};
|
||||
|
||||
struct Payload {
|
||||
const subscription::Subscription subscription;
|
||||
subscription::Subscription subscription;
|
||||
|
||||
const Event event;
|
||||
Event event;
|
||||
};
|
||||
|
||||
#include "twitch-eventsub-ws/payloads/stream-online-v1.inc"
|
||||
|
||||
@@ -33,23 +33,23 @@ namespace chatterino::eventsub::lib::payload::subscription {
|
||||
*/
|
||||
|
||||
struct Transport {
|
||||
const std::string method;
|
||||
const std::string sessionID;
|
||||
std::string method;
|
||||
std::string sessionID;
|
||||
};
|
||||
|
||||
struct Subscription {
|
||||
const std::string id;
|
||||
const std::string status;
|
||||
const std::string type;
|
||||
const std::string version;
|
||||
std::string id;
|
||||
std::string status;
|
||||
std::string type;
|
||||
std::string version;
|
||||
|
||||
// TODO: How do we map condition here? vector of key/value pairs?
|
||||
|
||||
const Transport transport;
|
||||
Transport transport;
|
||||
|
||||
// TODO: chronofy?
|
||||
const std::string createdAt;
|
||||
const int cost;
|
||||
std::string createdAt;
|
||||
int cost;
|
||||
};
|
||||
|
||||
#include "twitch-eventsub-ws/payloads/subscription.inc"
|
||||
|
||||
Reference in New Issue
Block a user