fix callers of embed functions due to param changes

This commit is contained in:
Luna 2019-10-25 10:49:35 -03:00
parent 2024c4bdf8
commit e0a849fa6a
3 changed files with 3 additions and 5 deletions

View File

@ -799,7 +799,7 @@ async def suppress_embeds(channel_id: int, message_id: int):
message["flags"] = message.get("flags", 0) | MessageFlags.suppress_embeds message["flags"] = message.get("flags", 0) | MessageFlags.suppress_embeds
await msg_update_embeds(message, [], app.storage, app.dispatcher) await msg_update_embeds(message, [])
elif not suppress and not url_embeds: elif not suppress and not url_embeds:
# spawn process_url_embed to restore the embeds, if any # spawn process_url_embed to restore the embeds, if any
await _msg_unset_flags(message_id, MessageFlags.suppress_embeds) await _msg_unset_flags(message_id, MessageFlags.suppress_embeds)

View File

@ -64,7 +64,7 @@ async def _get_default_user_avatar(default_id: int):
async def _handle_webhook_avatar(md_url_redir: str): async def _handle_webhook_avatar(md_url_redir: str):
md_url = make_md_req_url(app.config, "img", EmbedURL(md_url_redir)) md_url = make_md_req_url("img", EmbedURL(md_url_redir))
return redirect(md_url) return redirect(md_url)

View File

@ -499,9 +499,7 @@ async def execute_webhook(webhook_id: int, webhook_token):
await app.dispatcher.dispatch("channel", channel_id, "MESSAGE_CREATE", payload) await app.dispatcher.dispatch("channel", channel_id, "MESSAGE_CREATE", payload)
# spawn embedder in the background, even when we're on a webhook. # spawn embedder in the background, even when we're on a webhook.
app.sched.spawn( app.sched.spawn(process_url_embed(payload))
process_url_embed(app.config, app.storage, app.dispatcher, app.session, payload)
)
# we can assume its a guild text channel, so just call it # we can assume its a guild text channel, so just call it
await msg_guild_text_mentions(payload, guild_id, mentions_everyone, mentions_here) await msg_guild_text_mentions(payload, guild_id, mentions_everyone, mentions_here)