Luna Mendes
e0011d7a38
pubsub.lazy_guild: add implementation for role_update
2018-11-09 01:47:49 -03:00
Luna Mendes
950b9b83b2
pubsub.lazy_guild: add implementations for new_role and role_pos_update
2018-11-09 01:19:49 -03:00
Luna Mendes
6c63e014ae
blueprints.guild.roles: add basic comms between roles bp and lazy guilds
...
- pubsub.lazy_guild: add LazyGuildDispatcher.dispatch
- pubsub.lazy_guild: add GuildMemberList.role_delete
2018-11-09 00:47:22 -03:00
Luna Mendes
6245f08289
Merge branch 'lazy-guilds' into 'master'
...
Lazy guilds
Closes #12 , #9 , #8 , and #2
See merge request luna/litecord!2
2018-11-08 02:12:45 +00:00
Luna Mendes
748eacf112
pubsub.lazy_guild: fix bugs around p_idx calculation
2018-11-07 23:03:48 -03:00
Luna Mendes
3b532fa8b0
blueprints.users: fix settings being updated for everyone
2018-11-07 22:52:26 -03:00
Luna Mendes
134cc0eec8
pubsub.lazy_guild: add draft impl for complex updates
2018-11-07 22:51:16 -03:00
Luna Mendes
8b093d3d16
pubsub.lazy_guild: better algorithm for presence updates
...
this gives the separation between "complex" and "simple"
presence updates we can generalize on.
2018-11-07 21:07:31 -03:00
Luna Mendes
7be9d30f5d
cmd.migration: add debug log
2018-11-07 19:16:44 -03:00
Luna Mendes
a394c02477
schemas: add USER_SETTINGS.status
2018-11-07 19:15:07 -03:00
Luna Mendes
e1a946eb87
pubsub.lazy_guild: use filter instead of genexpr
2018-11-07 19:10:27 -03:00
Luna Mendes
773ab8fd18
pubsub.lazy_guild: fix fetching user id from item
...
- pubsub.lazy_guild: fix get_state on unknown session id
2018-11-07 19:08:31 -03:00
Luna Mendes
bd9c4cb26c
pubsub.lazy_guild: add implementation for pres_update
...
- utils: fix index_by_func
2018-11-07 18:52:50 -03:00
Luna Mendes
c212cbd392
pubsub.lazy_guild: change some instance vars to properties
...
- utils: add index_by_func
2018-11-07 17:53:31 -03:00
Luna Mendes
7bcd08ef7a
pubsub.lazy_guild: remove LazyGuildDispatcher.unsub
...
states subscribe via shard_query only.
2018-11-07 17:13:30 -03:00
Luna Mendes
3b2f6062fc
pubsub.lazy_guild: subscribe user to the given range
2018-11-07 16:41:22 -03:00
Luna Mendes
55f8919689
pubsub.lazy_guilds: add support for 'everyone'-type GMLs
...
if the everyone role can read the channel, then the member list
will be equivalent to any other list where the everyone role
can read the channel. with this in mind we can generate a "global"
member list directed only for that usecase.
- permissions: add role_permissions
2018-11-07 04:11:17 -03:00
Luna Mendes
86923cc6e3
README: add migrate instructions
2018-11-06 20:49:43 -03:00
Luna Mendes
db9fd783f5
manage.cmd.migration: add rudimentary implementation
...
Also add table changes for future message embeds.
2018-11-06 20:46:17 -03:00
Luna Mendes
c3210bf5b0
manage: add dummy migration command
2018-11-06 18:43:36 -03:00
Luna Mendes
a1a914dc87
add manage.py
2018-11-06 17:42:27 -03:00
Luna Mendes
04d89a2214
pubsub.lazy_guilds: major refactor
...
This makes the whole process of generating a member list
easier to understand and modify (from my point of view).
The actual event dispatching functionality is not on this
commit.
- permissions: add optional storage kwarg
2018-11-05 22:04:48 -03:00
Luna Mendes
7c274f0f70
channels: add PUT /api/v6/:chan_id/permissions/:overwrite_id
...
This finishes the basics on channel overwrites.
SQL for instances:
```sql
DROP TABLE channel_overwrites;
```
Then run `schema.sql`.
- channels: finish implementations for update_{text,voice}_channel
- storage: fix _overwrite_convert
- schema.sql: use unique constraint instead of primary key in
channel_overwrites
2018-11-05 04:12:16 -03:00
Luna Mendes
8ffa14d934
ratelimits.handler: add check for when rule is none (404s)
2018-11-05 03:15:46 -03:00
Luna Mendes
c200ab8707
channels: add untested basic channel update
...
- channels: fix upserts
- users: fix upserts
2018-11-05 03:12:09 -03:00
Luna Mendes
22fe0f07c6
channel: create channel.pins blueprint
...
- schemas: add CHAN_UPDATE and CHAN_OVERWRITE
2018-11-05 00:15:59 -03:00
Luna Mendes
03e42d9a43
users: use UPSERT when setting chan overrides
...
- channels: fix UPSERT
2018-11-04 23:46:18 -03:00
Luna Mendes
7ce59398c4
channels: use UPSERT on channel_ack
2018-11-04 23:41:52 -03:00
Luna Mendes
da8b049174
channel.messages: add permission checks
...
this commit only adds permission checking to most parts of the
message endpoints.
- channel.messages: fix extract_limit's default param
- channel.messages: check send_messages, mention_everyone, send_tts_messages
- channel.messages: check manage_messages
- blueprints.checks: add guild_perm_check, channel_perm_check
- errors: add error_code property, change some inheritance
- permissions: fix base_permissions
- storage: fix get_reactions
- storage: remove print-debug
- run: use error_code property when given
2018-11-04 19:55:21 -03:00
Luna Mendes
87dd70b4d9
permissions: add basic permission api
...
- litecord.auth: insert request.user_id
- storage: add get_member_role_ids
2018-11-04 17:54:48 -03:00
Luna Mendes
818571d336
gateway: add session_start_limit
2018-11-04 16:43:38 -03:00
Luna Mendes
c710ad5aaf
gateway.websocket: add _ws.session ratelimit
2018-11-04 16:36:11 -03:00
Luna Mendes
1f5f736a8e
ratelimits.main: rollback global_bucket to 50/1
2018-11-04 02:24:13 -03:00
Luna Mendes
a96b9c5e7f
ratelimits.handler: five better retry_after and global flag
...
- run: add X-RateLimit-Global and Retry-After headers
2018-11-04 02:23:26 -03:00
Luna Mendes
33f893c0ff
all: add ratelimit implementation
...
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
2018-11-04 02:06:40 -03:00
Luna Mendes
b17cfd46eb
run: add dummy ratelimiting handler
2018-11-03 22:48:36 -03:00
Luna Mendes
69fbd9c117
gateway.state_manager: send OP 7 Reconnect to clients
...
- 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
2018-11-03 21:58:51 -03:00
Luna Mendes
afb429ec77
gateway: change from 1200 guilds per shard to 1000
...
to more closely reproduce discord.
2018-11-03 20:58:01 -03:00
Luna Mendes
0f7ffaf717
storage: add Storage.get_reactions
...
This finishes basic reaction code (both inserting and putting a reaction).
SQL for instances:
```sql
DROP TABLE message_reactions;
```
Then rerun `schema.sql`
- channel.reactions: fix partial_emoji
- schema.sql: add message_reactions.react_ts and unique constraint
instead of primary key
2018-11-02 22:07:32 -03:00
Luna Mendes
db7fbdb954
run: load channel_reactions bp
2018-11-02 20:11:23 -03:00
Luna Mendes
1db27a811f
litecord.storage: proper fix for missing guild everyone role
2018-11-02 19:20:39 -03:00
Luna Mendes
378809bdd6
all: misc fixes
...
- gateway.websocket: fix etf dict decode
- auth: better token parsing
- auth: fix new_discrim calc
- channel.messages: call _dm_pre_dispatch on get_messages
- channels: fix get_pins
- guilds: make sure guild owner has guild everyone role
- invites: replace sub_guild to sub
2018-11-02 19:14:41 -03:00
Luna Mendes
2b1f9489b7
channel: add reactions blueprint
...
SQL for instances:
```sql
DROP TABLE message_reactions;
```
Then rerun `schema.sql`.
2018-11-02 18:29:07 -03:00
Luna Mendes
2f822408b9
channel.messages: add implementation for before, after and around
...
for GET /api/v6/channels/:id/messages.
2018-11-02 15:26:31 -03:00
Luna Mendes
f2d5913672
blueprints: split channels to channel.messages bp
2018-10-28 17:29:43 -03:00
Luna Mendes
8352a3cab4
guild.mod: add POST /guilds/:id/prune
2018-10-28 00:15:56 -03:00
Luna Mendes
5133aab849
guild.mod: fix get_prune
2018-10-28 00:01:59 -03:00
Luna Mendes
4d4b075de9
auth: move last_session update from gateway to auth
...
this should help in cases where the client has long-lived sessions (more
than a day)
2018-10-27 23:48:28 -03:00
Luna Mendes
80c29265f3
schema.sql: add users.last_session
...
- 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');
```
2018-10-27 23:40:35 -03:00
Luna Mendes
9aa9b3839b
guild.mod: add GET /guilds/:gid/prune
...
- users: fix get_me_guilds
- run: fix importing mod blueprint
2018-10-27 23:32:50 -03:00