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."""
|
"""Send an icon."""
|
||||||
icon = await app.icons.generic_get(
|
icon = await app.icons.generic_get(
|
||||||
scope, key, icon_hash, **kwargs)
|
scope, key, icon_hash, **kwargs)
|
||||||
|
|
||||||
if not icon:
|
if not icon:
|
||||||
return '', 404
|
return '', 404
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -274,8 +274,6 @@ class IconManager:
|
||||||
|
|
||||||
async def generic_get(self, scope, key, icon_hash, **kwargs) -> Icon:
|
async def generic_get(self, scope, key, icon_hash, **kwargs) -> Icon:
|
||||||
"""Get any icon."""
|
"""Get any icon."""
|
||||||
if icon_hash is None:
|
|
||||||
return None
|
|
||||||
|
|
||||||
log.debug('GET {} {} {}', scope, key, icon_hash)
|
log.debug('GET {} {} {}', scope, key, icon_hash)
|
||||||
key = str(key)
|
key = str(key)
|
||||||
|
|
|
||||||
|
|
@ -604,8 +604,10 @@ class Storage:
|
||||||
return [r[0] for r in rows]
|
return [r[0] for r in rows]
|
||||||
|
|
||||||
async def _msg_regex(self, regex, func, content) -> List[Dict]:
|
async def _msg_regex(self, regex, func, content) -> List[Dict]:
|
||||||
res = []
|
if content is None:
|
||||||
|
return []
|
||||||
|
|
||||||
|
res = []
|
||||||
for match in regex.finditer(content):
|
for match in regex.finditer(content):
|
||||||
found_id = match.group(1)
|
found_id = match.group(1)
|
||||||
|
|
||||||
|
|
@ -763,6 +765,9 @@ class Storage:
|
||||||
res['type'] = res['message_type']
|
res['type'] = res['message_type']
|
||||||
res.pop('message_type')
|
res.pop('message_type')
|
||||||
|
|
||||||
|
if res['content'] is None:
|
||||||
|
res['content'] = ""
|
||||||
|
|
||||||
channel_id = int(row['channel_id'])
|
channel_id = int(row['channel_id'])
|
||||||
content = row['content']
|
content = row['content']
|
||||||
guild_id = await self.guild_from_channel(channel_id)
|
guild_id = await self.guild_from_channel(channel_id)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue