Commit Graph

68 Commits

Author SHA1 Message Date
Cynthia Foxwell f162f0ab60 Update license headers 2021-09-24 11:33:06 -06:00
NotNite a1ca74f960
lazy_guild: remove member properly 2021-09-21 18:20:31 -04:00
luna 9fea3d7a43 lazy_guild: fix member list ordering 2021-09-01 00:31:57 +00:00
Luna f05b807f60 move dispatching logic to GatewayState
this makes gateway states have correct data for resuming
2021-08-30 00:09:34 -03:00
Luna d16a893d84 fix nick updates on lazy guilds 2021-08-29 22:59:18 -03:00
Luna 67785920bb lazy_guild: do not remove member nicks 2021-07-14 23:27:30 -03:00
Luna 07edc235f5 lazy_guild: add handling for member losing permissions 2021-07-14 21:45:43 -03:00
Luna 373b727084 Add helper bool magic method for state validity
Reported in #102
2020-05-01 11:39:21 -03:00
Luna 82d793ae07 Ignore states without websocket 2020-05-01 11:37:56 -03: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 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 e0e59f8b63 fix types (big)
varied fixes across many, many files.
2020-02-06 21:10:51 +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 9dab5b20ae typing, episode 2 2019-03-04 15:48:51 -03:00
Luna bbf80f72b1 fix tests and an ugly circular import 2019-03-04 05:24:40 -03:00
Luna d91030a2c1 typings, episode 1
(i installed mypy and its beautiful)
2019-03-04 05:09:04 -03:00
Luna 0759a52046 pubsub.lazy_guild: s/pop/remove on remove_channel 2019-03-04 03:16:28 -03:00
Luna f1127d1970 pubsub.lazy_guild: sanity of mind
- add more comments, always good
 - remove some unused methods and move some others to private methods
 - use _set_empty_list in close() method
2019-02-03 23:23:07 -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 7d6aab9a29 litecord.auth: use TimestampSigner
this fixes all tokens being the same.
2018-12-04 02:21:49 -03:00
Luna 8c4b7a1ac8 pubsub.lazy_guild: fix list_id for non-everyone lists
- utils: add murmurhash3 implementation
2018-12-04 02:02:40 -03:00
Luna 49edad8573 pubsub.lazy_guild: add dummy impl for chan_update 2018-12-02 19:16:00 -03:00
Luna bb36d7e669 pubsub.lazy_guild: add more checks for new group being None
presence updates aren't checking that value yet.
2018-12-02 18:52:16 -03:00
Luna 300f948ab2 pubsub.lazy_guild: remove member list from guild map too 2018-12-02 18:41:29 -03:00
Luna d1ef08fbd0 pubsub.lazy_guild: add cleanup of member lists
- blueprints.channel: delete member list when deleting channel
2018-12-02 18:37:49 -03:00
Luna Mendes d2bedb75a4 images: add implementation for gif handling
- images: prefix the icon_hash with `a_`
 - pubsub.lazy_guild: ignore update_user when unitialized list data
2018-11-21 20:01:16 -03:00
Luna Mendes 8818b00d6d blueprints.users: call lazy guild updates upon user update
- pubsub.lazy_guild: add update_user handler
2018-11-19 23:11:27 -03:00
Luna Mendes 113ba3fb89 pubsub.lazy_guild: better method to remove member 2018-11-19 04:10:18 -03:00
Luna Mendes 994c3eb640 pubzub.lazy_guild: remove any of the user's states on remove_member 2018-11-19 03:50:15 -03:00
Luna Mendes ed628abab2 guild.mod: use remove_member in lazy_guilds
- pubsub.lazy_guild: add remove_member handler
 - users: use guild.mod's remove_member
2018-11-19 03:36:31 -03:00
Luna Mendes 906e891f6e blueprints.invites: call new_member event for member lists
- pubsub.lazy_guild: add new_member handler
2018-11-19 03:15:37 -03:00
Luna Mendes b17d166377 pubsub.lazy_guild: update member roles in MemberList 2018-11-18 18:43:20 -03:00
Luna Mendes 1868d86fed pubsub.lazy_guild: update old presence's roles and status 2018-11-18 18:37:59 -03:00
Luna Mendes 38b01600aa pubsub.lazy_guild: handle unknown role on role_pos_update
- pubsub.lazy_guild: handle item_index being None on resync_by_item
2018-11-18 18:33:35 -03:00
Luna Mendes e38cb38e5f pubsub.lazy_guild: fix role_pos_update giving a method to get_subs 2018-11-18 18:26:55 -03:00
Luna Mendes 46759a4e7c pylint pass
fixing unused imports across all code
2018-11-13 01:40:31 -03:00
Luna Mendes 1b637ef3cc pubsub.lazy_guild: remove print and pprint calls 2018-11-12 02:08:48 -03:00
Luna Mendes fad8484a74 pubsub.lazy_guild: use SYNC instead of DELETE->INSERT->DELETE
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
2018-11-12 02:02:56 -03:00
Luna Mendes ea6e228bb4 pubsub.lazy_guild: use member ids instead of presences on main list 2018-11-11 00:14:59 -03:00
Luna Mendes 864f6a5d9f guild.members: add basic handling of nicks in lazy guilds
- pubsub.lazy_guilds: add a list lock to prevent inconsistencies
 - pubsub.lazy_guilds: add a lot of debug info related to list sorting
2018-11-09 19:02:26 -03:00
Luna Mendes f34c3f6296 pubsub.lazy_guilds: fix role_delete not finding group for role
- pubsub.lazy_guilds: add presence reassignment on role_delete
 - pubsub.lazy_guilds: fix getting role_range due to incorrect operators
2018-11-09 17:18:35 -03:00
Luna Mendes 7103ac01ca pubsub.lazy_guild: sort groups in decreasing position order 2018-11-09 04:33:29 -03:00
Luna Mendes ad0aa95f64 pubsub.lazy_guilds: add debug calls for role_pos_update 2018-11-09 04:11:52 -03:00
Luna Mendes 1d7a71a6ad pubsub.lazy_guild: bugfixes and better role_* methods
this fixes role_create and role_delete, adds more debug logging
to understand what is going on, etc.

 - pubsub.lazy_guild: promote role_update -> new_role when updating to
    hoist=True
 - pubsub.lazy_guild: promote role_update -> role_delete when updating
    to hoist=False
 - pubsub.lazy_guild: better handling of unknown group items on
    role_delete
2018-11-09 03:56:00 -03:00
Luna Mendes 5fa5aac2f5 pubsub.lazy_guild: bugfixes, take 2 2018-11-09 03:12:48 -03:00
Luna Mendes 17dfeb0f11 pubsub.lazy_guild: bugfixes 2018-11-09 03:09:55 -03:00
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