Commit Graph

31 Commits

Author SHA1 Message Date
Cynthia Foxwell f162f0ab60 Update license headers 2021-09-24 11:33:06 -06:00
Luna 59e2f9a91a presence: fill in client_status 2021-08-28 19:56:58 -03:00
Luna 1d2df14527 black run 2021-06-25 15:19:38 -03:00
abc641 96b4a6e60f Fix of gateway mass updating 2020-05-14 20:22:49 +00:00
Luna b1d1f4f228 add better docstring to update_status
- simplify logic to fetch game
 - safer getting when making final status
2020-03-14 20:05:14 +00:00
Luna b1aef75bb2 presence: remove TODO
that function is already shard-aware since we started subscribing at the
websocket start instead of fetching session ids for every single
dispatch.
2020-02-17 22:36:56 -03:00
Luna b0eb3247fd remove code from dispatcher
leftovers are TBD.

 - constrict Dispatcher.dispatch() to arity 3
 - add helper methods to Dispatcher
 - add EventType to Dispatcher

While fixing things, it was discovered that many of the things inside
LazyGuildDispatcher were just interfaces to GuildMemberList, in a very
weird way, just so it could be fitted inside the main Dispatcher. it was
decided to remove those unecessary interfaces, clients shall use the
manager directly.
2020-02-09 21:20:08 +00:00
Luna 7db5ce62c1 presence: fix removed shard field
closes #80
2020-02-03 18:29:11 -03:00
Luna 0f600543e8 Refactor GatewayState with proper types
Make websocket loop be inside app context
2020-01-30 01:50:50 +00:00
Luna 83a1c1ae29 black fmt pass 2019-10-25 07:27:50 -03:00
Luna 2c7c313a53 fix inconsistent presence objects
adds default values to presence.mobile and presence.client_status, as we
don't add any checks for them

client_status is presented on ae03e00ed2 (diff-b307d936b736f302bc7cc153f0d8a0a3)

mobile isn't shown anywhere but was used for mobile indicators. more on
https://luna.gitlab.io/discord-unofficial-docs/mobile_indicator.html
2019-05-05 17:49:58 -03:00
Luna d20626e716 litecord.presence: add docstrings / better function naming 2019-03-20 02:04:36 -03:00
Luna 9dab5b20ae typing, episode 2 2019-03-04 15:48:51 -03:00
Luna d95b6adb16 run.py: only pass app instance to PresenceManager
- presence: only receive app when instantiating
2019-02-03 22:44:43 -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 78c136b20d presence: default to online on missing status in state.presence 2018-12-06 01:00:27 -03:00
Luna Mendes 0aa679677f user_storage: add UserStorage.get_user_guilds
So that we're consistent.

 - gateway.websocket, presence: change to UserStorage for
    get_user_guilds
2018-11-17 18:41:54 -03:00
Luna Mendes 46759a4e7c pylint pass
fixing unused imports across all code
2018-11-13 01:40:31 -03:00
Luna Mendes 58c818bb68 guild.members: call pres_dispatch on role updates
- presence: fix 'everyone' list detection
2018-11-09 16:38:19 -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 856839d9e7 presence: don't send PRESENCE_UPDATEs about the same user 2018-10-26 03:50:29 -03:00
Luna Mendes 2605836790 dispatcher: add dispatch_filter
- 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.
2018-10-24 19:09:05 -03:00
Luna Mendes d28c0f1bc6 litecord.pubsub: add FriendDispatcher
- gateway.websocket: subscribe to friends on startup
 - presence: dispatch to friends on dispatch_pres
 - storage: add Storage.get_friend_ids
2018-10-12 16:17:29 -03:00
Luna Mendes 46fac95979 gateway.websocket: add presences field to ready payload
- 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
2018-10-12 02:10:31 -03:00
Luna Mendes 5afc15c4f6 storage: fix bug on last_message_id
- storage: better member.roles
 - presence: cast guild_id to str
2018-10-04 04:13:46 -03:00
Luna Mendes 34eda81e4f remove some print debug 2018-09-26 18:10:43 -03:00
Luna Mendes d242ef230a gateway.websocket: various fixes to presence
- 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
2018-09-26 18:08:12 -03:00
Luna Mendes dd4ae44080 gateway.websocket: rudimentary lazy guilds
implementation details are on the docstrings for _handle_14.

 - presence: merge member dict instead of copying some fields from it
2018-09-10 22:32:58 -03:00
Luna Mendes cd5dbc4886 Rough presence management
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
2018-09-10 01:09:09 -03:00
Luna Mendes d39783e666 Add barebones implementation for GUILD_SYNC
- 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
2018-09-01 23:53:36 -03:00