mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Merge branch 'unique-embed-urls' into 'master'
Ensure unique embed URLs Closes #41 See merge request chicken-riders/RcGcDb!19
This commit is contained in:
commit
dba037e1e9
|
@ -185,6 +185,10 @@ async def feeds_embed_formatter(post_type, post, message_target, wiki, article_p
|
||||||
embed.add_field(_("Report this on the support server"), settings["support"])
|
embed.add_field(_("Report this on the support server"), settings["support"])
|
||||||
else:
|
else:
|
||||||
embed.add_field(_("Report this on the support server"), change_params)
|
embed.add_field(_("Report this on the support server"), change_params)
|
||||||
|
if "?" in embed["url"]:
|
||||||
|
embed["url"] = embed["url"] + "&_rcid={}".format(post["id"])
|
||||||
|
else:
|
||||||
|
embed["url"] = embed["url"] + "?_rcid={}".format(post["id"])
|
||||||
embed.finish_embed()
|
embed.finish_embed()
|
||||||
return embed
|
return embed
|
||||||
|
|
||||||
|
@ -271,4 +275,4 @@ class DiscussionsFromHellParser:
|
||||||
elif mark["type"] == "em":
|
elif mark["type"] == "em":
|
||||||
prefix += "_"
|
prefix += "_"
|
||||||
suffix = "_" + suffix
|
suffix = "_" + suffix
|
||||||
return prefix, suffix
|
return prefix, suffix
|
||||||
|
|
|
@ -1149,5 +1149,9 @@ async def embed_formatter(action, change, parsed_comment, categories, recent_cha
|
||||||
new_cat = (_("**Added**: ") + ", ".join(list(categories["new"])[0:16]) + ("\n" if len(categories["new"])<=15 else _(" and {} more\n").format(len(categories["new"])-15))) if categories["new"] else ""
|
new_cat = (_("**Added**: ") + ", ".join(list(categories["new"])[0:16]) + ("\n" if len(categories["new"])<=15 else _(" and {} more\n").format(len(categories["new"])-15))) if categories["new"] else ""
|
||||||
del_cat = (_("**Removed**: ") + ", ".join(list(categories["removed"])[0:16]) + ("" if len(categories["removed"])<=15 else _(" and {} more").format(len(categories["removed"])-15))) if categories["removed"] else ""
|
del_cat = (_("**Removed**: ") + ", ".join(list(categories["removed"])[0:16]) + ("" if len(categories["removed"])<=15 else _(" and {} more").format(len(categories["removed"])-15))) if categories["removed"] else ""
|
||||||
embed.add_field(_("Changed categories"), new_cat + del_cat)
|
embed.add_field(_("Changed categories"), new_cat + del_cat)
|
||||||
|
if "?" in embed["url"]:
|
||||||
|
embed["url"] = embed["url"] + "&_rcid={}".format(change["rcid"])
|
||||||
|
else:
|
||||||
|
embed["url"] = embed["url"] + "?_rcid={}".format(change["rcid"])
|
||||||
embed.finish_embed()
|
embed.finish_embed()
|
||||||
return embed
|
return embed
|
||||||
|
|
Loading…
Reference in a new issue