fix: Channel creation matching bug

Bug where the channel creation dialog wouldn't throw an error if you
typed the name of an existing channel that had hyphens, or a channel
with the same name but spaces instead of hyphens. This is because
channelnames are stores with underscores internally, and channelnames
were not sanitized in the `checkChannel()` method on the `Db` class
This commit is contained in:
April Hall 2025-02-09 23:45:41 -05:00
parent ee1eac23ab
commit 6ae992d586
Signed by: arithefirst
GPG Key ID: 4508A15C4DB91C5B

View File

@ -73,6 +73,7 @@ class Db {
async checkChannel(channel: string): Promise<boolean> {
try {
channel = sanitizeChannelName(channel);
const res = await this.client.execute(`SELECT table_name FROM system_schema.tables WHERE keyspace_name = 'channels' AND table_name = ?`, [
channel.toLowerCase(),
]);