mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-31 05:05:38 +00:00
READY changes for threads ported from #876
This commit is contained in:
@@ -450,7 +450,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
||||
...member.guild.toJSON(),
|
||||
joined_at: member.joined_at,
|
||||
|
||||
threads: [],
|
||||
threads: member.guild.channels.filter((x) => x.isThread()),
|
||||
};
|
||||
});
|
||||
const generateGuildsListTime = taskSw.getElapsedAndReset();
|
||||
|
||||
@@ -36,7 +36,7 @@ export enum ChannelPermissionOverwriteType {
|
||||
member = 1,
|
||||
group = 2,
|
||||
}
|
||||
export interface threadMetadata {
|
||||
export interface ThreadMetadata {
|
||||
archived: boolean;
|
||||
auto_archive_duration: number;
|
||||
archive_timestamp: string;
|
||||
|
||||
@@ -45,4 +45,7 @@ export interface ChannelModifySchema {
|
||||
flags?: number;
|
||||
default_thread_rate_limit_per_user?: number;
|
||||
video_quality_mode?: number;
|
||||
auto_archive_duration?: number;
|
||||
archived?: boolean;
|
||||
locked?: boolean;
|
||||
}
|
||||
|
||||
@@ -16,10 +16,12 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ChannelType } from "../api";
|
||||
|
||||
export interface MessageThreadCreationSchema {
|
||||
auto_archive_duration?: number;
|
||||
rate_limit_per_user?: number;
|
||||
name: string;
|
||||
type?: number;
|
||||
type?: ChannelType.GUILD_NEWS_THREAD | ChannelType.GUILD_PRIVATE_THREAD | ChannelType.GUILD_PUBLIC_THREAD;
|
||||
location?: string; //0 clue what this means lol
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ export interface ReadyPrivateChannel {
|
||||
type: ChannelType.DM | ChannelType.GROUP_DM;
|
||||
}
|
||||
|
||||
export type GuildOrUnavailable = { id: string; unavailable: boolean } | (Guild & { joined_at?: Date; unavailable: undefined });
|
||||
export type GuildOrUnavailable = { id: string; unavailable: boolean } | (Guild & { joined_at?: Date; unavailable: undefined; threads: Channel[] });
|
||||
|
||||
const guildIsAvailable = (guild: GuildOrUnavailable): guild is Guild & { joined_at: Date; unavailable: false } => {
|
||||
const guildIsAvailable = (guild: GuildOrUnavailable): guild is Guild & { joined_at: Date; unavailable: false; threads: Channel[] } => {
|
||||
return guild.unavailable != true;
|
||||
};
|
||||
|
||||
@@ -215,7 +215,7 @@ export class ReadyGuildDTO implements IReadyGuildDTO {
|
||||
this.roles = guild.roles.map((x) => x.toJSON());
|
||||
this.stage_instances = [];
|
||||
this.stickers = guild.stickers;
|
||||
this.threads = [];
|
||||
this.threads = guild.threads;
|
||||
this.version = "1"; // ??????
|
||||
this.guild_hashes = {};
|
||||
this.joined_at = guild.joined_at;
|
||||
|
||||
Reference in New Issue
Block a user