Commit Graph

26 Commits

Author SHA1 Message Date
Luna 9346c5c52c embed.sanitizer: check for MEDIA_PROXY being None 2019-09-13 18:52:20 -03:00
Luna 28602dfa68 Merge branch 'webhook-avatars-rewrite' into 'master'
Webhook avatars rewrite

See merge request litecord/litecord!34
2019-05-02 05:19:30 +00:00
Luna 454f368f94 tests.test_embeds: add tests for path_exists
- embed.sanitizer: better error handling when fetching the key
2019-04-26 17:00:01 -03:00
Luna 5a3740f41b add basic redirect for webhook avatars 2019-04-26 04:10:29 -03:00
Luna 1061eda096 embed.sanizier: quickfix for proxify() 2019-04-25 23:45:39 -03:00
Luna 0631f007c1 test_websocket: add test for etf
- embed.sanitizer: remove unused import
2019-04-25 22:44:34 -03:00
Luna b6da5ad9d3 embed.sanitizer: use try/except instead of key membership check 2019-04-25 22:17:15 -03:00
Luna ff9d421a3c embed.sanitizer: full refactor
- refactor the three main mediaproxy api client functions into a
    template function
 - simplify common code between everyone
 - add typings to fill_embed()

 - embed.schemas: add querystring to EmbedURL.to_md_path
2019-04-25 22:12:04 -03:00
Luna a93090ddbc handle nullable embeds when creating messages
somehow discordcr does that..
2019-04-04 12:52:41 -03:00
Luna 4a56500adb embed.messages: always pass url as EmbedURL
- embed.sanitizer: handle non-EmbedURL on fetch_embed
2019-03-19 00:44:34 -03:00
Luna 404783534c webhooks: add draft for avatar_url on webhook execute
this is a bit messy due to us having to call mediaproxy for the given
url, then store it on icons manager.

 - embed.messages: add is_media_url
 - embed.sanitizer: add fetch_raw_img
 - embed.schemas: add EmbedURL.to_md_path
2019-03-19 00:04:42 -03:00
Luna 9dab5b20ae typing, episode 2 2019-03-04 15:48:51 -03:00
Luna 428502d373 add (untested) impl for url embeds
this happens on process_url_embed, so there isn't a need for other code
to worry about it.

 - litecord.embed.sanitizer: add fetch_embed
2019-02-22 19:59:35 -03:00
Luna 9b76c472d0 embed.sanitizer: add log warn
- channel.messages: handle meta being None
 - schemas: add gift_code_sku_id
2019-02-01 20:57:12 -03:00
Luna 53d7515f8c all: update copyright year 2019-01-26 19:25:46 -03:00
Luna 2632d033fa all: add GPL header 2018-12-07 02:14:58 -03:00
Luna 060f225189 channel.messages: add url autoembeds
related to #27

 - embed.sanitizer: handle external config and session objects
 - storage: add Storage.execute_with_json
2018-12-05 19:07:43 -03:00
Luna e2720a4084 embed.sanitizer: fix double-slash on path
- run: add app.session
2018-12-05 03:08:54 -03:00
Luna 75a7c4d83a channel.messages: use fill_embed
- embed.sanitizer: fix fetching of keys in app.config
2018-12-05 02:55:09 -03:00
Luna e3653cac87 embed.sanitizer: remove mmh3 import 2018-12-05 02:43:11 -03:00
Luna e7d3559acc embed.sanitizer: add fetch_metadata function
- pipfile: remove mmh3
2018-12-05 02:42:00 -03:00
Luna cdd774ffc1 Pipfile: add aiohttp 2018-12-05 02:11:25 -03:00
Luna 13c9c4b826 embed.sanitizer: add proxify function 2018-12-05 01:54:52 -03:00
Luna 9b5902db95 tests: add test_embeds
- embeds.schemas: add EMBED_FIELD and EMBED_OBJECT.fields to use it
2018-12-04 22:54:39 -03:00
Luna 5de64a93ee embed.sanitizer: remove unused _sane function 2018-12-04 21:50:11 -03:00
Luna 5db633b797 channel.messages: use sanitize_embed
- embed: add sanitizer module
 - embed.schemas: add to_json to EmbedURL
 - utils: add custom JSON encoder
 - run: use custom JSON encoder
 - gateway.websocket: use custom JSON encoder
2018-12-04 21:45:14 -03:00