Commit Graph

941 Commits

Author SHA1 Message Date
Luna 6872139ff6 gateway.websocket: do chunked sends on zlib stream
this should fix issues with big payloads being sent
as a single big websocket message to a client (potentially crashing it).

chunked sends split the payload into 1KB chunks that are each
sent through the websocket. clients are already supposed to handle
this behavior from the zlib-stream docs.

 - utils: add yield_chunks
2018-12-10 01:44:44 -03:00
Luna 5c38198137 user_storage: fix channel_overrides being a dict 2018-12-10 00:51:03 -03:00
Luna c5ccc5a9d0 attachments: fix syntax error 2018-12-09 19:27:39 -03:00
Luna 348430838e attachments: add sanitizer for pillow format kwarg 2018-12-09 19:21:06 -03:00
Luna Mendes e81ca361bc Merge branch 'message-attachments' into 'master'
Message attachments

Closes #5

See merge request litecord/litecord!14
2018-12-09 05:02:50 +00:00
Luna 1555a4717e attachments: add gif resize support
- images: strip IconManager.resize_gif into its own function
2018-12-09 01:51:58 -03:00
Luna 35967cb714 attachments: add basic resizing
Needs GIF support.
2018-12-09 01:26:56 -03:00
Luna d093e9c1ce channel.messages: remove unused import 2018-12-09 00:10:06 -03:00
Luna a8704f8176 attachments: add attachment fetch impl
- channel.messages: fix width/height switching
2018-12-08 23:59:45 -03:00
Luna 7e17b6965e channel.message: fix issues related to file stream
- storage: remove mime fetch
2018-12-08 23:49:46 -03:00
Luna 501b82b4f0 storage: fix attachment ids fetch 2018-12-08 23:43:14 -03:00
Luna 54650161b9 storage: fix attachment.url 2018-12-08 23:39:56 -03:00
Luna 6c992588e9 channel.messages: fix insertion into attachments table
- channel.messages: add file write
 - images: make get_ext and get_mime public functions
 - storage: receive app instance instead of db
2018-12-08 23:38:52 -03:00
Luna 57f6e530f5 gitignore: add attachments folder 2018-12-08 23:23:08 -03:00
Luna d8d975d10b add attachments folder with .gitkeep 2018-12-08 23:22:38 -03:00
Luna e885bf859c migration.scripts: add attachments.{channel, message}_id
- schema.sql: remove message_attachments table

    it is uneeded since we have the columns in attachments
2018-12-08 23:21:11 -03:00
Luna 9ecc3d9e7e blueprints: fix register for attachments bp 2018-12-08 23:15:48 -03:00
Luna b6dd495121 run: register attachments bp 2018-12-08 23:13:48 -03:00
Luna 9ec8577b7f blueprints: add dummy attachment blueprint
- storage: add message attachment fetching (not working)
2018-12-08 23:12:43 -03:00
Luna ec062f75a8 channel.messages: add dummy implementation for attachment support 2018-12-08 23:01:07 -03:00
Luna a5643bc41a Merge branch 'master' into message-attachments 2018-12-08 22:23:54 -03:00
Luna 08a0de8040 schemas: fix GW_ACTIVITY validation 2018-12-08 22:18:17 -03:00
Luna d5ad4bb96d migration.scripts: add 10_add_attachments_table
- schema.sql: add attachments table
2018-12-08 22:08:37 -03:00
Luna ed7b873e0d users: remove all connected user states upon deletion
- users: fix security vuln with deterministic password_hash

deterministic password_hash enables users to guess the tokens
of existing deleted users, given the user id. we use password_hash
as the key to the signer.
2018-12-08 19:12:57 -03:00
Luna de3c6d00e6 relationships: add RelationshipBlocked
Related to #30.

Fixes parent commit
2018-12-08 18:48:27 -03:00
Luna 6f349d4668 Merge branch 'master' of gitlab.com:litecord/litecord 2018-12-08 18:44:45 -03:00
Luna 69493e6912 relationships: raise RelationshipFailed
this only applies to accounts that are not found.

related to #30
2018-12-08 18:42:40 -03:00
Luna Mendes 397086c41d Merge branch 'gpl-relicense' into 'master'
GPLv3 relicense

See merge request litecord/litecord!13
2018-12-08 21:33:24 +00:00
Luna 2632d033fa all: add GPL header 2018-12-07 02:14:58 -03:00
Luna a383f3a790 LICENSE: make it gplv3-only 2018-12-06 19:02:03 -03:00
Luna 36195ee28d LICENSE: relicense under GPL 2018-12-06 18:58:57 -03:00
Luna 91dba542df nginx: add directives for .well-known and nodeinfo 2018-12-06 17:44:50 -03:00
Luna 6defce0f9e channel.dm_checks: add friend check override
- user_storage: add UserStorage.are_friends_with
2018-12-06 17:09:40 -03:00
Luna d7bb5f9804 channel.dm_checks: add restricted_guilds checking 2018-12-06 16:47:21 -03:00
Luna 49a4b46f35 user_storage: add UserStorage.get_mutual_guilds 2018-12-06 16:28:08 -03:00
Luna e5c75011da relationships: use intersection op instead of union op 2018-12-06 01:57:34 -03:00
Luna fb21ea528e user.settings: remove json_fields
not used anymore since we use execute_with_json
2018-12-06 01:56:17 -03:00
Luna bab25ea336 user.settings: remove json import (again) 2018-12-06 01:48:51 -03:00
Luna 3e43efab32 user.settings: use execute_with_json
This reverts commit e3a6f2a542.
2018-12-06 01:48:22 -03:00
Luna e3a6f2a542 user.settings: remove unused json import 2018-12-06 01:41:20 -03:00
Luna c0b3462ffa user.settings: dont json.dumps val 2018-12-06 01:41:02 -03:00
Luna bcd846d779 user.settings: force jsonb conversion 2018-12-06 01:25:39 -03:00
Luna b7028d4a7d guilds: use always_icon when updating guild icon 2018-12-06 01:12:32 -03:00
Luna 1d86a87a5f gateway.websocket: properly handle status being none 2018-12-06 01:10:30 -03:00
Luna 3751e895ea schemas: make GUILD_UPDATE.icon nullable 2018-12-06 01:08:27 -03:00
Luna 35be76b14a enums: add ActivityType.WATCHING 2018-12-06 01:03:14 -03:00
Luna 78c136b20d presence: default to online on missing status in state.presence 2018-12-06 01:00:27 -03:00
Luna 1ba6fa5a3e gateway.websocket: merge default presence with given presence
should fix problems when presence does not have status field
2018-12-06 00:58:35 -03:00
Luna 5c3928069e schemas: remove requirement for GW_ACTIVITY.timestamps.start 2018-12-06 00:44:39 -03:00
Luna 1abf57efef gateway.websocket: handle heartbeats when state is None 2018-12-06 00:27:49 -03:00