mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
feat: add change group ownership / text system msg
This commit is contained in:
@@ -69,6 +69,7 @@ type Action =
|
||||
| { action: "copy_file_link"; attachment: API.File }
|
||||
| { action: "open_link"; link: string }
|
||||
| { action: "copy_link"; link: string }
|
||||
| { action: "make_owner"; channel: Channel; user: User }
|
||||
| { action: "remove_member"; channel: Channel; user: User }
|
||||
| { action: "kick_member"; target: Member }
|
||||
| { action: "ban_member"; target: Member }
|
||||
@@ -307,6 +308,15 @@ export default function ContextMenus() {
|
||||
}
|
||||
break;
|
||||
|
||||
case "make_owner":
|
||||
{
|
||||
// FIXME: add a modal for this
|
||||
data.channel.edit({
|
||||
owner: data.user._id,
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case "remove_member":
|
||||
{
|
||||
data.channel.removeMember(data.user._id);
|
||||
@@ -667,11 +677,29 @@ export default function ContextMenus() {
|
||||
contextualChannel.owner_id === userId &&
|
||||
userId !== uid
|
||||
) {
|
||||
generateAction({
|
||||
action: "remove_member",
|
||||
channel: contextualChannel,
|
||||
user: user!,
|
||||
});
|
||||
generateAction(
|
||||
{
|
||||
action: "make_owner",
|
||||
channel: contextualChannel,
|
||||
user: user!,
|
||||
},
|
||||
undefined,
|
||||
false,
|
||||
undefined,
|
||||
"var(--error)",
|
||||
);
|
||||
|
||||
generateAction(
|
||||
{
|
||||
action: "remove_member",
|
||||
channel: contextualChannel,
|
||||
user: user!,
|
||||
},
|
||||
undefined,
|
||||
false,
|
||||
undefined,
|
||||
"var(--error)",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user