From 90108b83fbe0b9d93fbc0ff51ece424f50d36bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Mon, 4 Oct 2021 14:30:46 +0200 Subject: [PATCH 2/2] Allow IRC channels to contain Matrix rooms too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is related to https://github.com/fedora-infra/noggin/pull/766 Signed-off-by: Aurélien Bompard --- ipaserver/plugins/fasutils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ipaserver/plugins/fasutils.py b/ipaserver/plugins/fasutils.py index f8fa9ec..f0844e0 100644 --- a/ipaserver/plugins/fasutils.py +++ b/ipaserver/plugins/fasutils.py @@ -42,7 +42,8 @@ class IRCChannel(Str): def _convert_scalar(self, value, index=None): value = super()._convert_scalar(value, index) - value = value.lstrip("#") - if not value.startswith("irc:"): + if ":/" not in value: + # Default to IRC + value = value.lstrip("#") value = "irc:///{}".format(value) return value -- 2.39.2