Blame 0002-Allow-IRC-channels-to-contain-Matrix-rooms-too.patch

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