Skip to content

Commit

Permalink
fix relationship type & guild pos + folder
Browse files Browse the repository at this point in the history
  • Loading branch information
DEVTomatoCake committed Sep 1, 2024
1 parent b34d928 commit 18a38e6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/api/routes/users/#id/harvest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
JSZipType,
Config,
Note,
RelationshipTypeString,
} from "@spacebar/util";
import { storage } from "../../../../cdn/util/Storage";

Expand Down Expand Up @@ -165,20 +166,14 @@ router.get(
soundboardSettings: {},
},
textAndImages: {
diversitySurrogate: "",
useThreadSidebar: false,
renderSpoilers: "ALWAYS",
showCommandSuggestions: true,
gifAutoPlay: user.settings.gif_auto_play,
animateEmoji: user.settings.animate_emoji,
animateStickers: user.settings.animate_stickers,
enableTtsCommand: user.settings.enable_tts_command,
messageDisplayCompact:
user.settings.message_display_compact,
explicitContentFilter: 2,
explicitContentFilter: user.settings.explicit_content_filter,
convertEmoticons: user.settings.convert_emoticons,
expressionSuggestionsEnabled: false,
dmSpamFilter: 0,
explicitContentSettings: {},
},
notifications: {},
Expand Down Expand Up @@ -214,10 +209,12 @@ router.get(
developerMode: user.settings.developer_mode,
},
guildFolders: {
folders: members.map((member) => ({
guildIds: [member.guild_id], // TODO
folders: user.settings.guild_folders.map((folder) => ({
...folder,
guildIds: folder.guild_ids,
guild_ids: undefined,
})),
guildPositions: [],
guildPositions: user.settings.guild_positions,
},
audioContextSettings: {},
communities: {},
Expand All @@ -226,7 +223,10 @@ router.get(
frecency: {},
},
connections: user.connected_accounts,
relationships: user.relationships,
relationships: user.relationships.map((relationship) => ({
...relationship,
type: RelationshipTypeString[relationship.type],
})),
guild_settings: members.map((member) => member.settings),
payments: [],
notes,
Expand Down Expand Up @@ -288,7 +288,7 @@ router.get(
}
if (app.cover_image) {
const coverImageFile = await storage.get(
"applications/" + app.id + "/" + app.cover_image,
"app-icons/" + app.id + "/" + app.cover_image,
);
if (coverImageFile)
await fs.writeFile(
Expand Down
7 changes: 7 additions & 0 deletions src/util/entities/Relationship.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ export enum RelationshipType {
friends = 1,
}

export const RelationshipTypeString = {
[RelationshipType.outgoing]: "PENDING_OUTGOING",
[RelationshipType.incoming]: "PENDING_INCOMING",
[RelationshipType.blocked]: "BLOCKED",
[RelationshipType.friends]: "FRIEND",
}

@Entity({
name: "relationships",
engine: dbEngine,
Expand Down

0 comments on commit 18a38e6

Please sign in to comment.