Allow denormalized room names

This commit is contained in:
Jack Kingsman
2026-01-19 13:07:28 -08:00
parent e92f134682
commit d6f6913ef2
7 changed files with 567 additions and 548 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -13,8 +13,8 @@
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<script type="module" crossorigin src="/assets/index-CgdvRjQo.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DTfLIjxa.css">
<script type="module" crossorigin src="/assets/index-D6IU3K0A.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CcK6B7WY.css">
</head>
<body>
<div id="root"></div>
+21 -2
View File
@@ -43,6 +43,7 @@ export function NewMessageModal({
const [contactKey, setContactKey] = useState('');
const [roomKey, setRoomKey] = useState('');
const [tryHistorical, setTryHistorical] = useState(false);
const [permitCapitals, setPermitCapitals] = useState(false);
const [error, setError] = useState('');
const [loading, setLoading] = useState(false);
const hashtagInputRef = useRef<HTMLInputElement>(null);
@@ -72,7 +73,9 @@ export function NewMessageModal({
setError(validationError);
return;
}
await onCreateHashtagChannel(`#${channelName}`, tryHistorical);
// Normalize to lowercase unless user explicitly permits capitals
const normalizedName = permitCapitals ? channelName : channelName.toLowerCase();
await onCreateHashtagChannel(`#${normalizedName}`, tryHistorical);
}
onClose();
} catch (err) {
@@ -103,7 +106,9 @@ export function NewMessageModal({
setLoading(true);
try {
await onCreateHashtagChannel(`#${channelName}`, tryHistorical);
// Normalize to lowercase unless user explicitly permits capitals
const normalizedName = permitCapitals ? channelName : channelName.toLowerCase();
await onCreateHashtagChannel(`#${normalizedName}`, tryHistorical);
setName('');
hashtagInputRef.current?.focus();
} catch (err) {
@@ -237,6 +242,20 @@ export function NewMessageModal({
/>
</div>
</div>
<div className="mt-3 space-y-1">
<label className="flex items-center gap-3 cursor-pointer">
<input
type="checkbox"
checked={permitCapitals}
onChange={(e) => setPermitCapitals(e.target.checked)}
className="w-4 h-4 rounded border-input accent-primary"
/>
<span className="text-sm">Permit capitals in room key derivation</span>
</label>
<p className="text-xs text-muted-foreground pl-7">
Not recommended; most companions normalize to lowercase
</p>
</div>
</TabsContent>
</Tabs>