<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3APingRFCParticipants</id>
	<title>Module:PingRFCParticipants - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3APingRFCParticipants"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:PingRFCParticipants&amp;action=history"/>
	<updated>2026-05-26T23:01:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:PingRFCParticipants&amp;diff=144303&amp;oldid=prev</id>
		<title>imported&gt;MjolnirPants at 15:51, 1 August 2021</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:PingRFCParticipants&amp;diff=144303&amp;oldid=prev"/>
		<updated>2021-08-01T15:51:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
p = {}&lt;br /&gt;
&lt;br /&gt;
--testing. I have no idea why I left this in here, but I did. Fight me.&lt;br /&gt;
function p.test(frame)&lt;br /&gt;
	local pgCont = mw.title.new(&amp;quot;User:MjolnirPants/Voices&amp;quot;):getContent()&lt;br /&gt;
	return pgCont&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--The container which is actually called by the template&lt;br /&gt;
function p.PingRFCUsers(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	return p._PingRFCUsers(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--The actual function&lt;br /&gt;
function p._PingRFCUsers(args)&lt;br /&gt;
	--dim the local variables that do not need to be&lt;br /&gt;
	--dimmed later (to be initialized from an existing var)&lt;br /&gt;
	local pageSource = &amp;quot;&amp;quot;&lt;br /&gt;
	local uName = &amp;quot;&amp;quot;&lt;br /&gt;
	--cat is the variable which will be returned&lt;br /&gt;
	local cat = &amp;quot;&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	--check the size of the arguments array&lt;br /&gt;
	--if there&amp;#039;s more than one, the second one&lt;br /&gt;
	--should be the name of the page on which&lt;br /&gt;
	--to find the discussion&lt;br /&gt;
	if args[2] then&lt;br /&gt;
		--get the title from the second argument&lt;br /&gt;
		pageSource = mw.title.new(args[2]):getContent()&lt;br /&gt;
		cat = &amp;quot;Pinging participants of [[&amp;quot; .. args[2] .. &amp;quot;#&amp;quot; .. args[1] ..&amp;quot;|previous discussion]]: {{ping&amp;quot;&lt;br /&gt;
	else		&lt;br /&gt;
		--If no second parameter was passed, then&lt;br /&gt;
		--the discussion is on the current page&lt;br /&gt;
		pageSource = mw.title.getCurrentTitle():getContent()&lt;br /&gt;
		cat = &amp;quot;Pinging participants of [[#&amp;quot; .. args[1] ..&amp;quot;|previous discussion]]: {{ping&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	--find the specified discussion in the page and trim the&lt;br /&gt;
	--contents to just that discussion&lt;br /&gt;
	local zz = 4&lt;br /&gt;
	local i, j = string.find(pageSource, &amp;quot;==&amp;quot; .. args[1] .. &amp;quot;==&amp;quot;)&lt;br /&gt;
	if i == nil then&lt;br /&gt;
		i, j = string.find(pageSource, &amp;quot;== &amp;quot; .. args[1] .. &amp;quot; ==&amp;quot;)&lt;br /&gt;
		zz = 6&lt;br /&gt;
	end&lt;br /&gt;
	pageSource = string.sub(pageSource, i + string.len(args[1]) + zz)&lt;br /&gt;
	--If this is the last discussion on the page, then&lt;br /&gt;
	--there&amp;#039;s no need to trim the end of the string off&lt;br /&gt;
	if string.find(pageSource, &amp;quot;==&amp;quot;) then&lt;br /&gt;
		i, j = string.find(pageSource, &amp;quot;==&amp;quot;)&lt;br /&gt;
		pageSource = string.sub(pageSource, 1, i - 1)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	--find the first username within that discussion&lt;br /&gt;
	--and prime the loop&lt;br /&gt;
	i, j = string.find(pageSource, &amp;quot;%[%[User:&amp;quot;)&lt;br /&gt;
	--prime these to be higher than i to avoid empty&lt;br /&gt;
	--strings being returned in edge cases&lt;br /&gt;
	local k, l, m, n = i + 1&lt;br /&gt;
	&lt;br /&gt;
	--Loop through the string, finding usernames and&lt;br /&gt;
	--trimming the string down until it can&amp;#039;t find&lt;br /&gt;
	--any more usernames in it.&lt;br /&gt;
	while i ~= nil do&lt;br /&gt;
		i, j = string.find(pageSource, &amp;quot;%[%[User:&amp;quot;)&lt;br /&gt;
		--don&amp;#039;t run the code if it didn&amp;#039;t find a username this loop&lt;br /&gt;
		if j then&lt;br /&gt;
			--trim the front of the string off and reset&lt;br /&gt;
			--where j points to (the character before the first&lt;br /&gt;
			--character in the username)&lt;br /&gt;
			pageSource = string.sub(pageSource, j)&lt;br /&gt;
			j = 1&lt;br /&gt;
			--find the next pipe&lt;br /&gt;
			k, l = string.find(pageSource, &amp;quot;|&amp;quot;)&lt;br /&gt;
			--find the next pair of right square brackets&lt;br /&gt;
			m, n = string.find(pageSource, &amp;quot;%]%]&amp;quot;)&lt;br /&gt;
			--decide which one ends the username, grab the&lt;br /&gt;
			--username and trim the string to the end of&lt;br /&gt;
			--that name&lt;br /&gt;
			if (m &amp;gt; k) then&lt;br /&gt;
				uName = string.sub(pageSource, j + 1, k - 1)&lt;br /&gt;
				pageSource = string.sub(pageSource, k)&lt;br /&gt;
			else&lt;br /&gt;
				uName = string.sub(pageSource, j + 1, m - 1)&lt;br /&gt;
				pageSource = string.sub(pageSource, m)&lt;br /&gt;
			end&lt;br /&gt;
			--store the name in the return variable, along&lt;br /&gt;
			--with a pipe, but only if that name doesn&amp;#039;t&lt;br /&gt;
			--already appear in the string with a pipe (so that&lt;br /&gt;
			--usernames which are contained in existing names&lt;br /&gt;
			--will still get added)&lt;br /&gt;
			if not string.find(cat, uName .. &amp;quot;|&amp;quot;) then&lt;br /&gt;
				cat = cat .. &amp;quot;|&amp;quot; .. uName&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	--finalize the return variable&lt;br /&gt;
	cat = cat .. &amp;quot;}} ~~~~&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	--all done&lt;br /&gt;
	return cat&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;MjolnirPants</name></author>
	</entry>
</feed>