From 538b1757a3885ab101b35c2fddc5c4a87ea622aa Mon Sep 17 00:00:00 2001 From: Jacob Schlecht Date: Mon, 29 Jun 2026 11:54:00 -0600 Subject: [PATCH 1/2] refactor: Reexport UserLimits, change getLimits to get limits Signed-off-by: Jacob Schlecht --- src/Client.ts | 7 +++++-- src/classes/User.ts | 9 +++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Client.ts b/src/Client.ts index 1acdb6f2..f4792fc8 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -611,11 +611,14 @@ export class Client extends AsyncEventEmitter { this.#slowmodeTimers.set(channelId, timer); } - getLimits(): UserLimits | undefined { + /** + * Backend enforced limits for the logged in user + */ + get limits(): UserLimits | undefined { if (!this.configured() || !this.user) { return; } - return this.user.getLimits(); + return this.user.limits; } } diff --git a/src/classes/User.ts b/src/classes/User.ts index 91d07763..ab872a3d 100644 --- a/src/classes/User.ts +++ b/src/classes/User.ts @@ -1,8 +1,8 @@ import type { User as APIUser, + UserLimits as APIUserLimits, DataEditUser, Presence, - UserLimits, } from "stoat-api"; import { decodeTime } from "ulid"; @@ -14,6 +14,8 @@ import type { Channel } from "./Channel.js"; import type { File } from "./File.js"; import { UserProfile } from "./UserProfile.js"; +export type UserLimits = APIUserLimits; + /** * User Class */ @@ -347,7 +349,10 @@ export class User { ); } - getLimits(): UserLimits | undefined { + /** + * Backend enforced limits for a user + */ + get limits(): UserLimits | undefined { if (!this.#collection.client.configured()) { return; } From 1b8d491595c67d6e6e130f7389d0b2abc8f8f259 Mon Sep 17 00:00:00 2001 From: Jacob Schlecht Date: Mon, 29 Jun 2026 11:56:45 -0600 Subject: [PATCH 2/2] fix: Use new userlimits on the client class Signed-off-by: Jacob Schlecht --- src/Client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Client.ts b/src/Client.ts index f4792fc8..ff9c035f 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -4,14 +4,14 @@ import { batch, createSignal } from "solid-js"; import { ReactiveMap } from "@solid-primitives/map"; import { AsyncEventEmitter } from "@vladfrangu/async_event_emitter"; import { API } from "stoat-api"; -import type { DataLogin, RevoltConfig, Role, UserLimits } from "stoat-api"; +import type { DataLogin, RevoltConfig, Role } from "stoat-api"; import type { Channel } from "./classes/Channel.js"; import type { Emoji } from "./classes/Emoji.js"; import type { Message } from "./classes/Message.js"; import type { Server } from "./classes/Server.js"; import type { ServerMember } from "./classes/ServerMember.js"; -import type { User } from "./classes/User.js"; +import type { User, UserLimits } from "./classes/User.js"; import { AccountCollection } from "./collections/AccountCollection.js"; import { BotCollection } from "./collections/BotCollection.js"; import { ChannelCollection } from "./collections/ChannelCollection.js";