Work on channels, render content of messages.

This commit is contained in:
Paul
2021-06-20 17:31:53 +01:00
parent 89f8ab2694
commit d0b9cf9090
30 changed files with 1415 additions and 58 deletions

View File

@@ -22,14 +22,13 @@ export function takeError(
return id;
}
export function getChannelName(client: Client, channel: Channel, users: User[], prefixType?: boolean): Children {
export function getChannelName(client: Client, channel: Channel, prefixType?: boolean): Children {
if (channel.channel_type === "SavedMessages")
return <Text id="app.navigation.tabs.saved" />;
if (channel.channel_type === "DirectMessage") {
let uid = client.channels.getRecipient(channel._id);
return <>{prefixType && "@"}{users.find(x => x._id === uid)?.username}</>;
return <>{prefixType && "@"}{client.users.get(uid)?.username}</>;
}
if (channel.channel_type === "TextChannel" && prefixType) {