summaryrefslogtreecommitdiff
path: root/dialogs
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2020-10-12 15:55:39 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2020-10-12 15:55:39 -0400
commitd48fe29da9d8a19cec982be5a8ea50589fb92c87 (patch)
tree08229eb7ce9b5fb37193de3a542c8341ca9c4915 /dialogs
parent21fdada41c817c7f9e2d81fcb7f0cd4232737665 (diff)
downloadabaddon-portaudio-d48fe29da9d8a19cec982be5a8ea50589fb92c87.tar.gz
abaddon-portaudio-d48fe29da9d8a19cec982be5a8ea50589fb92c87.zip
update invite regex
Diffstat (limited to 'dialogs')
-rw-r--r--dialogs/joinguild.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/dialogs/joinguild.cpp b/dialogs/joinguild.cpp
index e1cce38..8b7de23 100644
--- a/dialogs/joinguild.cpp
+++ b/dialogs/joinguild.cpp
@@ -42,11 +42,11 @@ JoinGuildDialog::JoinGuildDialog(Gtk::Window &parent)
void JoinGuildDialog::on_entry_changed() {
std::string s = m_entry.get_text();
- std::regex invite_regex(R"~(discord\.(gg|com)\/([a-zA-Z0-9]+)$)~", std::regex_constants::ECMAScript);
+ std::regex invite_regex(R"((https?:\/\/)?discord\.(gg(\/invite)?\/|com\/invite\/)([A-Za-z0-9\-]+))", std::regex_constants::ECMAScript);
std::smatch match;
bool full_url = std::regex_search(s, match, invite_regex);
if (full_url || IsCode(s)) {
- m_code = full_url ? match[2].str() : s;
+ m_code = full_url ? match[4].str() : s;
m_needs_request = true;
m_ok.set_sensitive(false);
} else {