This makes our implementation go off-spec (depends on what you'd even
call a spec, considering lazy guilds are not documented and probably
won't be), but well... *it works*
There are also a lot of print-debugs on this commit, will clean them up.
- pubsub.lazy_guild: filter empty groups out of items list
- pubsub.lazy_guild: check operator's op on Operation.to_dict
- pubsub.lazy_guild: add resync() method to deal with re-SYNCs easily
- pubsub.lazy_guild: fix get_item_index and get_group_item_index
- pubsub.lazy_guild: drop the ops in complex presence updates in favour
of using resync()
- pubsub.lazy_guild: resync on group resorting
- pubsub.lazy_guild: use resync() on role delete
haven't tested yet, but it should work in theory.
- gateway.websocket: add the 3 main ws ratelimits
- litecord: add ratelimits package
- ratelimits.main: add implementation
- run: add app_set_ratelimit_headers
- gateway.websocket: check StateManager flags on new connections
- gateway.websocket: cancel all tasks on GatewayWebsocket.wsp.tasks
- run: call StateManager.gen_close_tasks() and StateManager.close() on
app shutdown
- gateway.websocket: update users.last_session
SQL for instances:
```sql
ALTER TABLE users ADD COLUMN last_session timestamp without time zone default (now() at time zone 'utc');
```
- presence: (basic) handle member lists when presence update.
Note that the respective GUILD_UPDATE_MEMBER_LIST doesn't happen
yet. we'll need roles beforehand.
GuildMemberList, as of this commit, can generate a correct list
and handle (some of) the data given in OP 14. The implementation
is still rudimentary and there's a lot of work to finish.
- dispatcher: add LazyGuildDispatcher
- gateway.state_manager: add states_raw to fetch
a single state without uid
- gateway.websocket: remove rudimentary implementation
(moved it to GuildMemberList in litecord.pubsub.lazy_guild)
- presences: add PresenceManager.friend_presences
- blueprints.auth: fix resend route
- pubsub: add DispatcherWithState to decrease amount of
repeated code between GuildDispatcher and ChannelDispatcher
- storage: fix relationship id field
- blueprints.checks: fix party fetching
- blueprints.users: fix try_dm_state
- blueprints.users: fix create_dm
- blueprints.users: fix create_group_dm being used for 1-on-1 dm
- gateway.websocket: add support for pure zlib
- schemas: fix CREATE_GROUP_DM
- storage: fix _filter_recipients, get_channel and get_dms
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
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