fix icons and message history breaking

This commit is contained in:
gabixdev 2019-03-02 00:38:37 +01:00
parent a7dc9e01dc
commit e5cff415f5
No known key found for this signature in database
GPG Key ID: 3E00485503A1D8BA
3 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)