also add name to group_dm_channels, and a group_dm_members table.
SQL for moving to latest schema:
```sql
DROP TABLE dm_channels;
DROP TABLE group_dm_channels;
DROP TABLE channel_overwrites;
DROP TABLE guild_features;
```
Then rerun `schema.sql`.
- schema.sql: revamp channel_overwrites table
- schema.sql: add features table
- schema.sql: make guild_features use the features table
Drop the unused tables:
```sql
DROP TABLE message_attachments;
DROP TABLE message_reactions;
DROP TABLE channel_pins;
```
Rerun `schema.sql` to recreate them with the proper constraints.
friendships and blocks are possible, however presence code isn't ready
to handle presences of people who are friends.
SQL for instances, this is going to fix bad timestamps on the messages:
```sql
ALTER TABLE ONLY members ALTER COLUMN joined_at SET DEFAULT (now() at time zone 'utc');
ALTER TABLE ONLY messages ALTER COLUMN created_at SET DEFAULT (now() at time zone 'utc');
ALTER TABLE ONLY invites ALTER COLUMN created_at SET DEFAULT (now() at time zone 'utc');
```
After that, rerun the schema.sql file to have the new relationships
table.
- blueprints: add relationships blueprint
- enums: add RelationshipType
- storage: add get_relationships
- storage: fix bug on lazy guild changes and messages
- schemas: return validator.document instead of reqjson
- gateway.websocket: use Storage.get_relationships
Mostly adding guild_id to some events. It isn't complete support for
them, but its some of the way there.
- storage: give guild_id on get_message
- gateway.websocket: decrease logging for some stuff
- a debug log for the whole packet is still there for development
reasons, maybe i'll put it on a config option.
- gateway.websocket: dispatch an offline presence when the user has no
connections tied to them anymore
unicode!
sql for instances to upgrade:
alter table users alter column username type text;
alter table guilds alter column name type text;
alter table members alter column nickname type text;
alter table roles alter column name type text;
alter table bans alter column reason type text;
users can now join guilds!
invites:
- add GET /api/v6/invites/<invite_code>
- add DELETE /api/v6/invites/<invite_code>
- add GET /api/v6/guilds/<guild_id>/invites
- add GET /api/v6/channels/<channel_id>/invites
- add POST /api/v6/invite/<invite_code>
storage:
- add verification_level to invites
- add empty invite.guild.features
gateway.state_manager:
- add StateManager.user_states
- give a dummy offline state on guild_states
- this makes it possible for people to see offline members even when
those members never logged in (since the would have no state being
reffered to them)
- gateway.websocket: use get_member_ids on lazy guild handler
- auth: add GET /api/v6/auth/consent-required
- dispatcher: add dispatch_user_guild and dispatch_user
- run: use Origin header on Access-Control-Allow-Origin
- handle BadRequest instead of passing raise_err=False
- handle status.activities
- ready: call update_status BEFORE subscribing and dispatching_ready
presence:
- better presence object on guild_presences
schema:
- handle activities, change required to false in game
Lots of changes to get it working.
One day changes will be able to be small enough to be split across
commits.
- enums: use enum.Enum, make EasyEnum subclass
- enums: add ActivityType, ActivityFlags, StatusType
- gateway.state: use 128 random bits instead of 256
- gateway.state: add MAX_STORE_SIZE in PayloadStore and check it when
adding a new payload
- gateway.websocket: add GatewayWebsocket.update_status
- presence: add PresenceManager.dispatch_guild_pres and
PresenceManager.dispatch_pres
- schema: add snowflake, activity_type, status_external types
- schema: add GW_ACTIVITY, GW_STATUS_UPDATE
- storage: fix _channels_extra and fixes for ChannelType as enum instead of
class
- state_manager: add StateManager.guild_states
- add PresenceManager in the presence module
- fix get_user_guilds not returning ints
- gateway: add dummy handler for op 4
- gateway: add hazmat implementation for op 14
- run: keep websockets logger on INFO
- run: add more headers on app_after_request
This reverts commit cb70842280.
WEBSERVER_URL was made for the case where litecord is behind
a reverse proxy (nginx / cloudflare, etc). If the instance
isn't behind a reverse proxy, you can set WEBSERVER_URL to your
own local address.