chat: remove linking shortcodes to chatrooms

We use shortcodes for all channels now -- in general,
we don't want people to be joining them as chats.
This commit is contained in:
Matilde Park 2020-03-09 22:25:31 -04:00
parent 3f16359755
commit 078991864c

View File

@ -124,29 +124,12 @@ export class Message extends Component {
</p>
);
} else {
let chatroom = letter.text.match(
/([~][/])?(~[a-z]{3,6})(-[a-z]{6})?([/])(([a-z])+([/-])?)+/
);
if ((chatroom !== null) // matched possible chatroom
&& (chatroom[2].length > 2) // possible ship?
&& (urbitOb.isValidPatp(chatroom[2]) // valid patp?
&& (chatroom[0] === letter.text))) { // entire message is room name?
return (
<Link
className="bb b--black b--white-d f7 mono lh-copy v-top"
to={"/~chat/join/" + chatroom.input}>
{letter.text}
</Link>
);
}
else {
let text = letter.text.split ('\n').map ((item, i) => <p className='f7 lh-copy v-top' key={i}>{item}</p>);
return (
<section>
{text}
</section>
);
}
}
}