mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
add a slash before room if there is no other separator
This commit is contained in:
@@ -649,7 +649,18 @@ impl Message {
|
|||||||
if instance.contains("$ROOM") {
|
if instance.contains("$ROOM") {
|
||||||
instance.replace("$ROOM", &room)
|
instance.replace("$ROOM", &room)
|
||||||
} else {
|
} else {
|
||||||
format!("{}{}", instance, room)
|
// if there nothing that would separate the room, add a slash as a separator
|
||||||
|
// this way, urls can be given as "https://meet.jit.si" as well as "https://meet.jit.si/"
|
||||||
|
let maybe_slash = if instance.ends_with("/")
|
||||||
|
|| instance.ends_with("?")
|
||||||
|
|| instance.ends_with("#")
|
||||||
|
|| instance.ends_with("=")
|
||||||
|
{
|
||||||
|
""
|
||||||
|
} else {
|
||||||
|
"/"
|
||||||
|
};
|
||||||
|
format!("{}{}{}", instance, maybe_slash, room)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user