Currently client-side channels are "Twitch" channels for isTwitchChannel and have Twitch in the channel type enum. However they cannot be cast to TwitchChannel.
We should rework channel types, to resolve the type >= Twitch && type < TwitchEnd but can't be cast to TwitchChannel problem.
enum class Type {
None, // Unused? empty?
Direct, // Actually indirect channel, not sure where it's used though
Twitch, // Normal Twitch channel like #pajlada
// can execute commands, but not send messages, there are no moderator privileges, no vips, no broadcasters,
// no stream titles, ...
TwitchWhispers,
TwitchWatching,
TwitchMentions, // this could be made into a generic channel, there is no point of it being Twitch specifically, it's not a TwitchChannel anyway.
TwitchLive,
TwitchAutomod,
TwitchEnd,
Misc, // this is for local testing channels, can be left as is
};
The minimal modifications here would be:
enum class Type {
None,
Direct,
Twitch, // Normal Twitch channel like #pajlada
Whispers,
Watching,
Mentions,
Live,
Automod,
Misc, // this is for local testing channels, can be left as is
};
// make Channel::isTwitchChannel into:
bool Channel::isTwitchChannel() const {
return this->type_ == Channel::Type::Twitch;
}
There was an idea where instead of having an enum for a channel we instead would have some kind of flags for what traits supports, ex:
enum ChannelFlags {
PERMISSIONS = (1 << 0), // mods, vips, ...
TWITCH_COMMANDS = (1<<1), // allow for /w and friends to run
LOCAL = (1<<2),
STREAM_TITLE = (1<<3),
INDIRECT = (1<<4), // collects messages from more than one other channel,
// this could be used to add channel links at the start of messages (like /mentions)
};
Checklist
Describe your issue
Currently client-side channels are "Twitch" channels for
isTwitchChannel
and haveTwitch
in the channel type enum. However they cannot be cast toTwitchChannel
.We should rework channel types, to resolve the
type >= Twitch && type < TwitchEnd
but can't be cast toTwitchChannel
problem.The minimal modifications here would be:
There was an idea where instead of having an enum for a channel we instead would have some kind of flags for what traits supports, ex:
None
LOCAL
Direct
LOCAL
INDIRECT
flag,Twitch
PERMISSIONS+TWITCH_COMMANDS+STREAM_TITLE
TwitchWhispers
LOCAL+TWITCH_COMMANDS
TwitchWatching
LOCAL+TWITCH_COMMANDS
TwitchMentions
LOCAL+INDIRECT
TwitchLive
LOCAL
TwitchAutomod
LOCAL+INDIRECT
TwitchEnd
Misc
LOCAL
Screenshots
No response
OS and Chatterino Version
commit 5b1ce32a4e0afaa160ca4b6918914216483884b5 (HEAD -> master, origin/master, origin/HEAD)