Commit Graph

30 Commits

Author SHA1 Message Date
Luna 820a81087f update UserFlags 2021-09-02 22:04:00 -03:00
Luna dae56a68ae move events-intents table to enums module 2021-07-14 14:59:15 -03:00
Luna 566920b120 enums: make Intents an IntFlag subclass 2021-07-11 01:21:03 -03:00
Luna 49e1938ed6 enums: add Intents flags 2021-07-11 00:20:02 -03:00
George Tsatsis be089fe4dc
Add PUBLIC to guild enums 2020-03-31 00:31:50 +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
Hampus Kraft a666ca4fc0
feat: adding remaining user flags 2020-01-31 19:15:42 +01:00
Luna 420646e76f revamp how Flags works
instead of pulling a hack and injecting from_int() in `__init_subclass__`, we
just make an actual function, and cache the wanted attributes in the subclass
at its creation

this fixes statis analyzers claiming from_int() doesn't exist on
subclasses, for good reason, as they'd be turing-complete to do so, lol

 - auth: fix some mypy issues about reusing same variable
2019-10-25 10:00:35 -03:00
Luna 0cc1062c52 flake8 pass
- fix test_empty_embed not actually reporting on empty embeds
2019-10-25 08:06:26 -03:00
Luna 83a1c1ae29 black fmt pass 2019-10-25 07:27:50 -03:00
Luna ef6361dbda channels: update local message var when changing flags
- embed.messages: propagate payload.flags when updating msg embeds
 - enums: fix typo
 - channels: fix flag helper functions
 - storage: only fill res.member when user_id is given
 - storage: sentinel value is 0 instead of none for flags removal
2019-09-01 19:18:54 -03:00
Luna e0d253f36f add message flags updating on suppress embeds 2019-09-01 18:03:29 -03:00
Luna 717c02bdd7 admin_schemas: fix USER_UPDATE's coerce
- admin_api.users: fix missing attrs / wrong calls
 - enums: add Flags.value attr for an instantiated Flags
2019-04-22 01:45:26 -03:00
Luna c325543242 enums: move Feature to EasyEnum
- schemas: add validator for guild_features type
2019-03-11 01:40:18 -03:00
Luna 2c1c384409 admin_api.features: make features input as a list
- add PATCH /:id/features
 - enums: add Feature enum
 - schemas: add FEATURES
 - storage: add Storage.guild_features
 - types: add return type to timestamp_
2019-03-11 01:36:52 -03:00
Luna 0d38c7cc0c gateway.websocket: add basic vsu handling
this adds *theoretical* interfaces to a VoiceManager. The actual
VoiceManager does not work and probably any VSU being sent over will
crash the websocket with an AttributionError.

 - enums: add VOICE_CHANNELS
 - run: add App.voice attribute
2019-02-28 20:51:09 -03:00
Luna 53d7515f8c all: update copyright year 2019-01-26 19:25:46 -03:00
Luna 307a22e135 channel.pins: deny pins from system messages
suggested by @Cynosphere
2019-01-25 19:40:56 -03:00
Luna 2632d033fa all: add GPL header 2018-12-07 02:14:58 -03:00
Luna 35be76b14a enums: add ActivityType.WATCHING 2018-12-06 01:03:14 -03:00
Luna Mendes d62e140d8d user.billing: fix imports for process_subscription move
- enums: add PremiumType
2018-11-22 05:00:20 -03:00
Luna Mendes 25b34c6a8a enums: add MessageNotifications
- schemas: add msg_notifications type validator
 - schemas: add GUILD_SETTINGS, GUILD_SETTINGS_CHAN_OVERRIDE
2018-10-19 04:31:20 -03:00
Luna Mendes a62bc5af46 enums: add own Flags class
to help with understanding of user.flags and message.activity.type
2018-10-12 23:12:14 -03:00
Luna Mendes 051cdd8ff2 blueprints.users: finish user patch impl
- blueprints.auth: check availability of username on register
 - enums: add UserFlags
 - schemas: add DATA_REGEX, USER_UPDATE
 - storage: add dummy mobile and phone values on get_user
2018-10-12 21:34:45 -03:00
Luna Mendes 61e36f244b blueprints.users, channels: basic dm operations
SQL for instances:

```sql
ALTER TABLE messages
ADD CONSTRAINT messages_channels_fkey
FOREIGN KEY (channel_id)
REFERENCES channels (id)
ON DELETE CASCADE;

ALTER TABLE channel_pins ADD CONSTRAINT pins_channels_fkey
FOREIGN KEY (channel_id)
REFERENCES channels (id)
ON DELETE CASCADE;

ALTER TABLE channel_pins ADD CONSTRAINT pins_messages_fkey
FOREIGN KEY (message_id)
REFERENCES messages (id)
ON DELETE CASCADE;
```

After that, rerun `schema.sql`.

blueprints.channels:
 - check dms on channel_check
 - add DELETE /api/v6/channels/<int:channel_id>

blueprints.users:
 - add event dispatching for leaving guilds
 - add GET /api/v6/users/@me/channels, for DM fetching
 - add POST /api/v6/users/@me/channels, for DM creation
 - add POST /api/v6/users/<int:user_id>/channels for DM / Group DM
    creation

 - schemas: add CREATE, CREATE_GROUP_DM
 - storage: add last_message_id fetching for channels
 - storage: add support for DMs in get_channel
 - storage: add Storage.get_dm, Storage.get_dms, Storage.get_all_dms
 - schema.sql: add dm_channel_state table
 - schema.sql: add constriants for messages.channel_id and channel_pins
2018-10-03 21:49:35 -03:00
Luna Mendes c7923da124 relationship support!
friendships and blocks are possible, however presence code isn't ready
to handle presences of people who are friends.

SQL for instances, this is going to fix bad timestamps on the messages:

```sql
ALTER TABLE ONLY members ALTER COLUMN joined_at SET DEFAULT (now() at time zone 'utc');
 ALTER TABLE ONLY messages ALTER COLUMN created_at SET DEFAULT (now() at time zone 'utc');
ALTER TABLE ONLY invites ALTER COLUMN created_at SET DEFAULT (now() at time zone 'utc');
```

After that, rerun the schema.sql file to have the new relationships
table.

 - blueprints: add relationships blueprint
 - enums: add RelationshipType
 - storage: add get_relationships
 - storage: fix bug on lazy guild changes and messages
 - schemas: return validator.document instead of reqjson
 - gateway.websocket: use Storage.get_relationships
2018-10-02 03:43:57 -03:00
Luna Mendes 3858e20080 Add user notes
- blueprints.users: fix get_other
 - blueprints.users: add dummy get_user_settings,
     patch_current_settings, get_consent, get_harvest and get_library
 - enums: add ExplicitFilter
 - storage: add Storage.fetch_notes
 - schema.sql: add incomplete user_settings table
2018-09-22 20:18:48 -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 4ea3d353b3 litecord.blueprints: add channels blueprint 2018-07-02 05:06:57 -03:00
Luna Mendes c477b2ed50 storage: add channel fetching logic
- litecord: add enums
 - storage: add get_user
 - storage: use column::text instead of str() in some cases
2018-06-20 17:39:21 -03:00