1
0
mirror of https://github.com/spacebarchat/client.git synced 2024-11-25 03:32:54 +01:00

minor refactors

This commit is contained in:
Puyodead1 2024-03-11 13:34:04 -04:00
parent b5064031eb
commit 65f574f01e
No known key found for this signature in database
GPG Key ID: A4FA4FEC0DD353FC
6 changed files with 343 additions and 25 deletions

File diff suppressed because one or more lines are too long

View File

@ -11,6 +11,13 @@
}
]
},
{
"description": "A list of capabilities.",
"type": "array",
"items": {
"$ref": "#/definitions/Capability"
}
},
{
"description": "A list of capabilities.",
"type": "object",
@ -34,8 +41,7 @@
"type": "object",
"required": [
"identifier",
"permissions",
"windows"
"permissions"
],
"properties": {
"identifier": {
@ -85,15 +91,11 @@
}
},
"platforms": {
"description": "Target platforms this capability applies. By default all platforms applies.",
"default": [
"linux",
"macOS",
"windows",
"android",
"iOS"
"description": "Target platforms this capability applies. By default all platforms are affected by this capability.",
"type": [
"array",
"null"
],
"type": "array",
"items": {
"$ref": "#/definitions/Target"
}
@ -108,7 +110,7 @@
],
"properties": {
"urls": {
"description": "Remote domains this capability refers to. Can use glob patterns.",
"description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).",
"type": "array",
"items": {
"type": "string"
@ -126,6 +128,43 @@
"$ref": "#/definitions/Identifier"
}
]
},
{
"description": "Reference a permission or permission set by identifier and extends its scope.",
"type": "object",
"required": [
"identifier"
],
"properties": {
"identifier": {
"description": "Identifier of the permission or permission set.",
"allOf": [
{
"$ref": "#/definitions/Identifier"
}
]
},
"allow": {
"description": "Data that defines what is allowed by the scope.",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Value"
}
},
"deny": {
"description": "Data that defines what is denied by the scope.",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Value"
}
}
}
}
]
},
@ -313,6 +352,125 @@
"event:deny-unlisten"
]
},
{
"description": "image:default -> Default permissions for the plugin.",
"type": "string",
"enum": [
"image:default"
]
},
{
"description": "image:allow-from-bytes -> Enables the from_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-bytes"
]
},
{
"description": "image:allow-from-ico-bytes -> Enables the from_ico_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-ico-bytes"
]
},
{
"description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-path"
]
},
{
"description": "image:allow-from-png-bytes -> Enables the from_png_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-png-bytes"
]
},
{
"description": "image:allow-height -> Enables the height command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-height"
]
},
{
"description": "image:allow-new -> Enables the new command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-new"
]
},
{
"description": "image:allow-rgba -> Enables the rgba command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-rgba"
]
},
{
"description": "image:allow-width -> Enables the width command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-width"
]
},
{
"description": "image:deny-from-bytes -> Denies the from_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-bytes"
]
},
{
"description": "image:deny-from-ico-bytes -> Denies the from_ico_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-ico-bytes"
]
},
{
"description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-path"
]
},
{
"description": "image:deny-from-png-bytes -> Denies the from_png_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-png-bytes"
]
},
{
"description": "image:deny-height -> Denies the height command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-height"
]
},
{
"description": "image:deny-new -> Denies the new command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-new"
]
},
{
"description": "image:deny-rgba -> Denies the rgba command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-rgba"
]
},
{
"description": "image:deny-width -> Denies the width command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-width"
]
},
{
"description": "log:default -> Allows the log command",
"type": "string",

View File

@ -11,6 +11,13 @@
}
]
},
{
"description": "A list of capabilities.",
"type": "array",
"items": {
"$ref": "#/definitions/Capability"
}
},
{
"description": "A list of capabilities.",
"type": "object",
@ -34,8 +41,7 @@
"type": "object",
"required": [
"identifier",
"permissions",
"windows"
"permissions"
],
"properties": {
"identifier": {
@ -85,15 +91,11 @@
}
},
"platforms": {
"description": "Target platforms this capability applies. By default all platforms applies.",
"default": [
"linux",
"macOS",
"windows",
"android",
"iOS"
"description": "Target platforms this capability applies. By default all platforms are affected by this capability.",
"type": [
"array",
"null"
],
"type": "array",
"items": {
"$ref": "#/definitions/Target"
}
@ -108,7 +110,7 @@
],
"properties": {
"urls": {
"description": "Remote domains this capability refers to. Can use glob patterns.",
"description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).",
"type": "array",
"items": {
"type": "string"
@ -126,6 +128,43 @@
"$ref": "#/definitions/Identifier"
}
]
},
{
"description": "Reference a permission or permission set by identifier and extends its scope.",
"type": "object",
"required": [
"identifier"
],
"properties": {
"identifier": {
"description": "Identifier of the permission or permission set.",
"allOf": [
{
"$ref": "#/definitions/Identifier"
}
]
},
"allow": {
"description": "Data that defines what is allowed by the scope.",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Value"
}
},
"deny": {
"description": "Data that defines what is denied by the scope.",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Value"
}
}
}
}
]
},
@ -313,6 +352,125 @@
"event:deny-unlisten"
]
},
{
"description": "image:default -> Default permissions for the plugin.",
"type": "string",
"enum": [
"image:default"
]
},
{
"description": "image:allow-from-bytes -> Enables the from_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-bytes"
]
},
{
"description": "image:allow-from-ico-bytes -> Enables the from_ico_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-ico-bytes"
]
},
{
"description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-path"
]
},
{
"description": "image:allow-from-png-bytes -> Enables the from_png_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-png-bytes"
]
},
{
"description": "image:allow-height -> Enables the height command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-height"
]
},
{
"description": "image:allow-new -> Enables the new command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-new"
]
},
{
"description": "image:allow-rgba -> Enables the rgba command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-rgba"
]
},
{
"description": "image:allow-width -> Enables the width command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-width"
]
},
{
"description": "image:deny-from-bytes -> Denies the from_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-bytes"
]
},
{
"description": "image:deny-from-ico-bytes -> Denies the from_ico_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-ico-bytes"
]
},
{
"description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-path"
]
},
{
"description": "image:deny-from-png-bytes -> Denies the from_png_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-png-bytes"
]
},
{
"description": "image:deny-height -> Denies the height command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-height"
]
},
{
"description": "image:deny-new -> Denies the new command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-new"
]
},
{
"description": "image:deny-rgba -> Denies the rgba command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-rgba"
]
},
{
"description": "image:deny-width -> Denies the width command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-width"
]
},
{
"description": "log:default -> Allows the log command",
"type": "string",

View File

@ -138,7 +138,7 @@ const customRenderer: Partial<ReactRenderer> = {
content[0].length === 1 &&
typeof content[0][0] === "string"
) {
return <p>{content}</p>;
return <span>{content}</span>;
}
return <>{content}</>;

View File

@ -17,8 +17,8 @@ export function LeaveServerModal({ target, ...props }: ModalProps<"leave_server"
await app.rest
.delete(Routes.userGuild(target.id))
.then(() => {
modalController.pop("close");
navigate("/channels/@me");
modalController.pop("close");
})
.catch((e) => {
logger.error(e);

View File

@ -177,7 +177,8 @@ export default class Channel {
opts = { ...opts, around };
}
this.logger.info(`Fetching initial messages for ${this.id}`);
if (isInitial) this.logger.info(`Fetching initial messages for ${this.id}`);
else this.logger.info(`Fetching messages for ${this.id} before ${before}`);
app.rest
.get<RESTGetAPIChannelMessagesResult | APIError>(Routes.channelMessages(this.id), opts)
.then((res) => {