Remove ability to add bot as a friend.

This commit is contained in:
Paul 2021-08-12 17:11:34 +01:00
parent f548d91a7c
commit c5a36b09d9
2 changed files with 60 additions and 55 deletions

View file

@ -190,8 +190,11 @@ export const UserProfile = observer(
<Edit size={28} />
</IconButton>
)}
{(user.relationship === RelationshipStatus.Incoming ||
user.relationship === RelationshipStatus.None) && (
{!user.bot &&
(user.relationship ===
RelationshipStatus.Incoming ||
user.relationship ===
RelationshipStatus.None) && (
<IconButton onClick={() => user.addFriend()}>
<UserPlus size={28} />
</IconButton>

View file

@ -585,6 +585,7 @@ function ContextMenus(props: Props) {
}
if (user) {
if (!user.bot) {
let actions: Action["action"][];
switch (user.relationship) {
case RelationshipStatus.User:
@ -639,6 +640,7 @@ function ContextMenus(props: Props) {
} as unknown as Action);
}
}
}
if (contextualChannel) {
if (contextualChannel.channel_type === "Group" && uid) {