Implement "send_link" macro (#6767)

When to_chat gets converted to a proc, then the construct of to_chat(some, link(url)) will no longer work. Or will produce odd results.

As a result, the send_link macro is now created. Replaced existent instances of the previous construct and added a simple grep check for this as well. It won't catch all, probably, but it'll catch the most common instances.
This commit is contained in:
Erki
2019-07-22 01:22:44 +03:00
committed by GitHub
parent 645a79aa89
commit 38e4b5d77b
8 changed files with 15 additions and 13 deletions
+3 -3
View File
@@ -194,9 +194,9 @@
else if (alert("This will open the Github page in your browser. Are you sure?",, "Yes", "No") == "Yes")
if (href_list["pr"])
var/pr_link = "[config.githuburl]pull/[href_list["pr"]]"
to_chat(src, link(pr_link))
send_link(src, pr_link)
else
to_chat(src, link(config.githuburl))
send_link(src, config.githuburl)
// Forum link from various panels.
if ("forums")
@@ -671,7 +671,7 @@
log_debug("Unrecognized process_webint_link() call used. Route sent: '[route]'.")
return
to_chat(src, link(linkURL))
send_link(src, linkURL)
return
/client/verb/show_greeting()
+1 -1
View File
@@ -251,7 +251,7 @@ datum/preferences
if(href_list["preference"] == "open_whitelist_forum")
if(config.forumurl)
to_chat(user, link(config.forumurl))
send_link(user, config.forumurl)
else
to_chat(user, "<span class='danger'>The forum URL is not set in the server configuration.</span>")
return