<?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%3AMass_notification</id>
	<title>Module:Mass notification - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AMass_notification"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Mass_notification&amp;action=history"/>
	<updated>2026-05-26T03:33:56Z</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:Mass_notification&amp;diff=143935&amp;oldid=prev</id>
		<title>imported&gt;Mr. Stradivarius: update user limit to 50</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Mass_notification&amp;diff=143935&amp;oldid=prev"/>
		<updated>2015-09-07T21:50:23Z</updated>

		<summary type="html">&lt;p&gt;update user limit to 50&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module sends out notifications to multiple users.&lt;br /&gt;
&lt;br /&gt;
local MAX_USERS = 50 -- The Echo user limit as of September 2015.&lt;br /&gt;
local GROUP_PAGE_PATH = &amp;#039;Module:Mass notification/groups/&amp;#039;&lt;br /&gt;
local NO_NAME_ERROR = &amp;#039;no group name was specified&amp;#039;&lt;br /&gt;
local LOAD_ERROR = &amp;#039;the group &amp;quot;[[$1|$2]]&amp;quot; was not found&amp;#039;&lt;br /&gt;
local MAX_USER_ERROR = &amp;#039;attempted to send notifications to more than $1 users&amp;#039;&lt;br /&gt;
local NO_USER_ERROR = &amp;#039;could not find any usernames in $1&amp;#039;&lt;br /&gt;
local INTRO_BLURB = &amp;#039;Notifying all members of $1&amp;#039;&lt;br /&gt;
	.. &amp;#039; &amp;lt;small&amp;gt;([[Template:Mass notification|more info]]&amp;#039;&lt;br /&gt;
	.. &amp;quot; &amp;#039;&amp;#039;&amp;#039;·&amp;#039;&amp;#039;&amp;#039; &amp;quot;&lt;br /&gt;
	.. &amp;#039;&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[$2 opt out]&amp;lt;/span&amp;gt;)&amp;lt;/small&amp;gt;: &amp;#039;&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function message(msg, ...)&lt;br /&gt;
	return mw.message.newRawMessage(msg):params{...}:plain()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function makeWikitextError(msg)&lt;br /&gt;
	return string.format(&lt;br /&gt;
		&amp;#039;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;Error: %s.&amp;lt;/strong&amp;gt;&amp;#039;,&lt;br /&gt;
		msg&lt;br /&gt;
	)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.groupSubmodule(frame)&lt;br /&gt;
	-- Returns either the group link or the group name, depending on whether&lt;br /&gt;
	-- the submodule can be found. For use in edit notices.&lt;br /&gt;
	local groupName = frame.args[1]&lt;br /&gt;
	local success, data = pcall(mw.loadData, GROUP_PAGE_PATH .. groupName)&lt;br /&gt;
	if success and type(data) == &amp;#039;table&amp;#039; and data.group_page then&lt;br /&gt;
		return string.format(&amp;#039;[[%s|%s]]&amp;#039;, data.group_page, groupName)&lt;br /&gt;
	else&lt;br /&gt;
		return groupName&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(groupName)&lt;br /&gt;
	-- Validate input.&lt;br /&gt;
	if type(groupName) ~= &amp;#039;string&amp;#039; then&lt;br /&gt;
		return makeWikitextError(NO_NAME_ERROR)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local groupSubmodule = GROUP_PAGE_PATH .. groupName&lt;br /&gt;
&lt;br /&gt;
	-- Load the group submodule and check for errors.&lt;br /&gt;
	local data&lt;br /&gt;
	do&lt;br /&gt;
		local success&lt;br /&gt;
		success, data = pcall(mw.loadData, groupSubmodule)&lt;br /&gt;
		if not success then&lt;br /&gt;
			return makeWikitextError(message(LOAD_ERROR, groupSubmodule, groupName))&lt;br /&gt;
		elseif type(data) ~= &amp;#039;table&amp;#039; or not data[1] then -- # doesn&amp;#039;t work with mw.loadData&lt;br /&gt;
			return makeWikitextError(message(NO_USER_ERROR, groupName))&lt;br /&gt;
		elseif data[MAX_USERS + 1] then -- # doesn&amp;#039;t work with mw.loadData&lt;br /&gt;
			return makeWikitextError(message(MAX_USER_ERROR, tostring(MAX_USERS)))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Make the intro blurb.&lt;br /&gt;
	local introBlurb&lt;br /&gt;
	do&lt;br /&gt;
		local optOutUrl = tostring(mw.uri.fullUrl(&lt;br /&gt;
			groupSubmodule,&lt;br /&gt;
			{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		))&lt;br /&gt;
		local groupLink&lt;br /&gt;
		if data.group_page then&lt;br /&gt;
			groupLink = string.format(&amp;#039;[[%s|%s]]&amp;#039;, data.group_page, groupName)&lt;br /&gt;
		else&lt;br /&gt;
			groupLink = groupName&lt;br /&gt;
		end&lt;br /&gt;
		introBlurb = message(INTRO_BLURB, groupLink, optOutUrl)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Make the user links.&lt;br /&gt;
	local userLinks&lt;br /&gt;
	do&lt;br /&gt;
		local userNamespace = mw.site.namespaces[2].name&lt;br /&gt;
		local links = {}&lt;br /&gt;
		for i, username in ipairs(data) do&lt;br /&gt;
			username = tostring(username)&lt;br /&gt;
			links[i] = string.format(&lt;br /&gt;
				&amp;#039;[[%s:%s]]&amp;#039;,&lt;br /&gt;
				userNamespace,&lt;br /&gt;
				username&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
		userLinks = string.format(&lt;br /&gt;
			&amp;#039;&amp;lt;span style=&amp;quot;display: none;&amp;quot;&amp;gt;(%s)&amp;lt;/span&amp;gt;&amp;#039;,&lt;br /&gt;
			table.concat(links, &amp;#039;, &amp;#039;)&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return introBlurb .. userLinks&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, {&lt;br /&gt;
		wrappers = &amp;#039;Template:Mass notification&amp;#039;&lt;br /&gt;
	})&lt;br /&gt;
	local groupName = args[1]&lt;br /&gt;
	return p._main(groupName)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Mr. Stradivarius</name></author>
	</entry>
</feed>