mirror of https://gitlab.com/litecord/litecord.git
fix icons and message history breaking
This commit is contained in:
parent
a7dc9e01dc
commit
e5cff415f5
|
|
@ -27,7 +27,6 @@ async def send_icon(scope, key, icon_hash, **kwargs):
|
|||
"""Send an icon."""
|
||||
icon = await app.icons.generic_get(
|
||||
scope, key, icon_hash, **kwargs)
|
||||
|
||||
if not icon:
|
||||
return '', 404
|
||||
|
||||
|
|
|
|||
|
|
@ -274,8 +274,6 @@ class IconManager:
|
|||
|
||||
async def generic_get(self, scope, key, icon_hash, **kwargs) -> Icon:
|
||||
"""Get any icon."""
|
||||
if icon_hash is None:
|
||||
return None
|
||||
|
||||
log.debug('GET {} {} {}', scope, key, icon_hash)
|
||||
key = str(key)
|
||||
|
|
|
|||
|
|
@ -604,8 +604,10 @@ class Storage:
|
|||
return [r[0] for r in rows]
|
||||
|
||||
async def _msg_regex(self, regex, func, content) -> List[Dict]:
|
||||
res = []
|
||||
if content is None:
|
||||
return []
|
||||
|
||||
res = []
|
||||
for match in regex.finditer(content):
|
||||
found_id = match.group(1)
|
||||
|
||||
|
|
@ -763,6 +765,9 @@ class Storage:
|
|||
res['type'] = res['message_type']
|
||||
res.pop('message_type')
|
||||
|
||||
if res['content'] is None:
|
||||
res['content'] = ""
|
||||
|
||||
channel_id = int(row['channel_id'])
|
||||
content = row['content']
|
||||
guild_id = await self.guild_from_channel(channel_id)
|
||||
|
|
|
|||
Loading…
Reference in New Issue