From 66ea960f71444c8da82db17f6b5c70c8b1256e32 Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Sun, 18 Nov 2018 01:05:53 -0300 Subject: [PATCH] gateway.websocket: anoter Storage -> UserStorage --- litecord/blueprints/channel/messages.py | 4 +--- litecord/gateway/websocket.py | 2 +- litecord/storage.py | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/litecord/blueprints/channel/messages.py b/litecord/blueprints/channel/messages.py index 0e12168..d11eaa8 100644 --- a/litecord/blueprints/channel/messages.py +++ b/litecord/blueprints/channel/messages.py @@ -181,7 +181,7 @@ async def create_message(channel_id): ) payload = await app.storage.get_message(message_id, user_id) - + if ctype == ChannelType.DM: # guild id here is the peer's ID. await _dm_pre_dispatch(channel_id, user_id) @@ -190,8 +190,6 @@ async def create_message(channel_id): await app.dispatcher.dispatch('channel', channel_id, 'MESSAGE_CREATE', payload) - # TODO: dispatch the MESSAGE_CREATE to any mentioning user. - if ctype == ChannelType.GUILD_TEXT: for str_uid in payload['mentions']: uid = int(str_uid) diff --git a/litecord/gateway/websocket.py b/litecord/gateway/websocket.py index 5b03805..9be301e 100644 --- a/litecord/gateway/websocket.py +++ b/litecord/gateway/websocket.py @@ -765,7 +765,7 @@ class GatewayWebsocket: """ data = payload['d'] - gids = await self.storage.get_user_guilds(self.state.user_id) + gids = await self.user_storage.get_user_guilds(self.state.user_id) guild_id = int(data['guild_id']) # make sure to not extract info you shouldn't get diff --git a/litecord/storage.py b/litecord/storage.py index c6354a0..ea94a0b 100644 --- a/litecord/storage.py +++ b/litecord/storage.py @@ -662,7 +662,6 @@ class Storage: return str(role_id) if role_id == guild_id: - # TODO: check MENTION_EVERYONE permission return str(role_id) role = await self.get_role(role_id, guild_id)