diff --git a/src/BasicChannel.cpp b/src/BasicChannel.cpp index 513d351..3273461 100644 --- a/src/BasicChannel.cpp +++ b/src/BasicChannel.cpp @@ -125,6 +125,16 @@ void BasicChannel::setChannelType(ChannelType::ChannelType type) { properties()[property::CHANNEL_FLAG_SEMI_PERMANENT] = type == ChannelType::semipermanent; } +void BasicChannel::updateChannelType(std::vector &properties, ChannelType::ChannelType type) { + if(this->properties()[property::CHANNEL_FLAG_PERMANENT].update_value(type == ChannelType::permanent)) { + properties.push_back(property::CHANNEL_FLAG_PERMANENT); + } + + if(this->properties()[property::CHANNEL_FLAG_SEMI_PERMANENT].update_value(type == ChannelType::semipermanent)) { + properties.push_back(property::CHANNEL_FLAG_SEMI_PERMANENT); + } +} + bool BasicChannel::verify_password(const std::optional &password, bool password_hashed) { if(!this->properties()[property::CHANNEL_FLAG_PASSWORD].as_unchecked()) { return true; diff --git a/src/BasicChannel.h b/src/BasicChannel.h index 5f00d23..e59860b 100644 --- a/src/BasicChannel.h +++ b/src/BasicChannel.h @@ -51,6 +51,7 @@ namespace ts { ChannelType::ChannelType channelType(); void setChannelType(ChannelType::ChannelType); + void updateChannelType(std::vector& /* updates */, ChannelType::ChannelType /* target type */); [[nodiscard]] bool verify_password(const std::optional&, bool /* password already hashed */);