mirror of https://gitlab.com/litecord/litecord.git
schema.sql: add user_settings table
rerunning the schema.sql file should get you up and running.
- add POST /api/v6/users/@me/consent for consent changes (that get
ignored)
This commit is contained in:
parent
993a2f3b08
commit
4841565f14
|
|
@ -156,13 +156,13 @@ async def get_user_settings():
|
||||||
},
|
},
|
||||||
'gif_auto_play': True,
|
'gif_auto_play': True,
|
||||||
'guild_positions': [],
|
'guild_positions': [],
|
||||||
|
'restricted_guilds': [],
|
||||||
'inline_attachment_media': True,
|
'inline_attachment_media': True,
|
||||||
'inline_embed_media': True,
|
'inline_embed_media': True,
|
||||||
'locale': 'en-US',
|
'locale': 'en-US',
|
||||||
'message_display_compact': False,
|
'message_display_compact': False,
|
||||||
'render_embeds': True,
|
'render_embeds': True,
|
||||||
'render_reactions': True,
|
'render_reactions': True,
|
||||||
'restricted_guilds': [],
|
|
||||||
'show_current_game': True,
|
'show_current_game': True,
|
||||||
'status': 'online',
|
'status': 'online',
|
||||||
'theme': 'dark',
|
'theme': 'dark',
|
||||||
|
|
@ -175,9 +175,14 @@ async def patch_current_settings():
|
||||||
return '', 204
|
return '', 204
|
||||||
|
|
||||||
|
|
||||||
@bp.route('/@me/consent', methods=['GET'])
|
@bp.route('/@me/consent', methods=['GET', 'POST'])
|
||||||
async def get_consent():
|
async def get_consent():
|
||||||
"""Always disable data collection."""
|
"""Always disable data collection.
|
||||||
|
|
||||||
|
Also takes any data collection changes
|
||||||
|
by the client and ignores them, as they
|
||||||
|
will always be false.
|
||||||
|
"""
|
||||||
return jsonify({
|
return jsonify({
|
||||||
'usage_statistics': {
|
'usage_statistics': {
|
||||||
'consented': False,
|
'consented': False,
|
||||||
|
|
@ -193,11 +198,13 @@ async def get_harvest():
|
||||||
"""Dummy route"""
|
"""Dummy route"""
|
||||||
return '', 204
|
return '', 204
|
||||||
|
|
||||||
|
|
||||||
@bp.route('/@me/activities/statistics/applications', methods=['GET'])
|
@bp.route('/@me/activities/statistics/applications', methods=['GET'])
|
||||||
async def get_stats_applications():
|
async def get_stats_applications():
|
||||||
"""Dummy route for info on gameplay time and such"""
|
"""Dummy route for info on gameplay time and such"""
|
||||||
return jsonify([])
|
return jsonify([])
|
||||||
|
|
||||||
|
|
||||||
@bp.route('/@me/library', methods=['GET'])
|
@bp.route('/@me/library', methods=['GET'])
|
||||||
async def get_library():
|
async def get_library():
|
||||||
"""Probably related to Discord Store?"""
|
"""Probably related to Discord Store?"""
|
||||||
|
|
|
||||||
72
schema.sql
72
schema.sql
|
|
@ -78,48 +78,70 @@ CREATE TABLE IF NOT EXISTS users (
|
||||||
PRIMARY KEY (id, username, discriminator)
|
PRIMARY KEY (id, username, discriminator)
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
-- main user settings
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS user_settings (
|
CREATE TABLE IF NOT EXISTS user_settings (
|
||||||
id bigint REFERENCES users (id),
|
id bigint REFERENCES users (id),
|
||||||
afk_timeout int DEFAULT 300,
|
afk_timeout int DEFAULT 300,
|
||||||
animate_emoji bool DEFAULT true,
|
|
||||||
convert_emoticons bool DEFAULT false,
|
-- connection detection (none by default)
|
||||||
default_guilds_restricted bool DEFAULT false,
|
|
||||||
detect_platform_accounts bool DEFAULT false,
|
detect_platform_accounts bool DEFAULT false,
|
||||||
|
|
||||||
-- smirk emoji
|
-- privacy and safety
|
||||||
developer_mode bool DEFAULT true,
|
-- options like data usage are over
|
||||||
|
-- the get_consent function on users blueprint
|
||||||
disable_games_tab bool DEFAULT true,
|
default_guilds_restricted bool DEFAULT false,
|
||||||
enable_tts_command bool DEFAULT false,
|
|
||||||
explicit_content_filter int DEFAULT 2,
|
explicit_content_filter int DEFAULT 2,
|
||||||
|
friend_source jsonb DEFAULT '{"all": true}',
|
||||||
|
|
||||||
friend_source_everyone bool DEFAULT true,
|
-- guild positions on the client.
|
||||||
friend_source_mutuals bool DEFAULT true,
|
guild_positions jsonb DEFAULT '[]',
|
||||||
friend_source_guilds bool DEFAULT true,
|
|
||||||
|
|
||||||
gif_auto_play bool DEFAULT true,
|
-- guilds that can't dm you
|
||||||
|
restricted_guilds jsonb DEFAULT '[]',
|
||||||
|
|
||||||
-- TODO: guild_positions
|
|
||||||
-- TODO: restricted_guilds
|
|
||||||
|
|
||||||
inline_attachment_media bool DEFAULT true,
|
|
||||||
inline_embed_media bool DEFAULT true,
|
|
||||||
locale text DEFAULT 'en-US',
|
|
||||||
message_display_compact bool DEFAULT false,
|
|
||||||
render_embeds bool DEFAULT true,
|
|
||||||
render_reactions bool DEFAULT true,
|
render_reactions bool DEFAULT true,
|
||||||
|
|
||||||
|
-- show the current palying game
|
||||||
|
-- as an activity
|
||||||
show_current_game bool DEFAULT true,
|
show_current_game bool DEFAULT true,
|
||||||
|
|
||||||
|
-- text and images
|
||||||
|
|
||||||
|
-- show MEDIA embeds for urls
|
||||||
|
inline_embed_media bool DEFAULT true,
|
||||||
|
|
||||||
|
-- show thumbnails for attachments
|
||||||
|
inline_attachment_media bool DEFAULT true,
|
||||||
|
|
||||||
|
-- autoplay gifs on the client
|
||||||
|
gif_auto_play bool DEFAULT true,
|
||||||
|
|
||||||
|
-- render OpenGraph embeds for urls posted in chat
|
||||||
|
render_embeds bool DEFAULT true,
|
||||||
|
|
||||||
|
-- play animated emojis
|
||||||
|
animate_emoji bool DEFAULT true,
|
||||||
|
|
||||||
|
-- convert :-) to the smile emoji and others
|
||||||
|
convert_emoticons bool DEFAULT false,
|
||||||
|
|
||||||
|
-- enable /tts
|
||||||
|
enable_tts_command bool DEFAULT false,
|
||||||
|
|
||||||
|
-- appearance
|
||||||
|
message_display_compact bool DEFAULT false,
|
||||||
status text DEFAULT 'online' NOT NULL,
|
status text DEFAULT 'online' NOT NULL,
|
||||||
theme text DEFAULT 'dark' NOT NULL,
|
theme text DEFAULT 'dark' NOT NULL,
|
||||||
|
developer_mode bool DEFAULT true,
|
||||||
|
disable_games_tab bool DEFAULT true,
|
||||||
|
locale text DEFAULT 'en-US',
|
||||||
|
|
||||||
timezone_offset int DEFAULT 0,
|
-- set by the client
|
||||||
|
-- the server uses this to make emails
|
||||||
|
-- about "look at what youve missed"
|
||||||
|
timezone_offset int DEFAULT 0
|
||||||
);
|
);
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS notes (
|
CREATE TABLE IF NOT EXISTS notes (
|
||||||
user_id bigint REFERENCES users (id),
|
user_id bigint REFERENCES users (id),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue