aboutsummaryrefslogtreecommitdiff
path: root/src/mod_announce.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mod_announce.erl')
-rw-r--r--src/mod_announce.erl65
1 files changed, 63 insertions, 2 deletions
diff --git a/src/mod_announce.erl b/src/mod_announce.erl
index 013594af8..f74d43888 100644
--- a/src/mod_announce.erl
+++ b/src/mod_announce.erl
@@ -5,7 +5,7 @@
%%% Created : 11 Aug 2003 by Alexey Shchepin <alexey@process-one.net>
%%%
%%%
-%%% ejabberd, Copyright (C) 2002-2019 ProcessOne
+%%% ejabberd, Copyright (C) 2002-2020 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -35,7 +35,7 @@
-export([start/2, stop/1, reload/3, export/1, import_info/0,
import_start/2, import/5, announce/1, send_motd/1, disco_identity/5,
disco_features/5, disco_items/5, depends/2,
- send_announcement_to_all/3, announce_commands/4,
+ send_announcement_to_all/3, announce_commands/4, mod_doc/0,
announce_items/4, mod_opt_type/1, mod_options/1, clean_cache/1]).
-export([init/1, handle_call/3, handle_cast/2,
handle_info/2, terminate/2, code_change/3]).
@@ -917,3 +917,64 @@ mod_options(Host) ->
{cache_size, ejabberd_option:cache_size(Host)},
{cache_missed, ejabberd_option:cache_missed(Host)},
{cache_life_time, ejabberd_option:cache_life_time(Host)}].
+
+mod_doc() ->
+ #{desc =>
+ [?T("This module enables configured users to broadcast "
+ "announcements and to set the message of the day (MOTD). "
+ "Configured users can perform these actions with an XMPP "
+ "client either using Ad-hoc Commands or sending messages "
+ "to specific JIDs."), "",
+ ?T("The Ad-hoc Commands are listed in the Server Discovery. "
+ "For this feature to work, 'mod_adhoc' must be enabled."), "",
+ ?T("The specific JIDs where messages can be sent are listed below. "
+ "The first JID in each entry will apply only to the specified "
+ "virtual host example.org, while the JID between brackets "
+ "will apply to all virtual hosts in ejabberd:"), "",
+ "example.org/announce/all (example.org/announce/all-hosts/all)::",
+ ?T("The message is sent to all registered users. If the user is "
+ "online and connected to several resources, only the resource "
+ "with the highest priority will receive the message. "
+ "If the registered user is not connected, the message will be "
+ "stored offline in assumption that offline storage (see 'mod_offline') "
+ "is enabled."),
+ "example.org/announce/online (example.org/announce/all-hosts/online)::",
+ ?T("The message is sent to all connected users. If the user is "
+ "online and connected to several resources, all resources will "
+ "receive the message."),
+ "example.org/announce/motd (example.org/announce/all-hosts/motd)::",
+ ?T("The message is set as the message of the day (MOTD) and is sent "
+ "to users when they login. In addition the message is sent to all "
+ "connected users (similar to announce/online)."),
+ "example.org/announce/motd/update (example.org/announce/all-hosts/motd/update)::",
+ ?T("The message is set as message of the day (MOTD) and is sent to users "
+ "when they login. The message is not sent to any currently connected user."),
+ "example.org/announce/motd/delete (example.org/announce/all-hosts/motd/delete)::",
+ ?T("Any message sent to this JID removes the existing message of the day (MOTD).")],
+ opts =>
+ [{access,
+ #{value => ?T("AccessName"),
+ desc =>
+ ?T("This option specifies who is allowed to send announcements "
+ "and to set the message of the day. The default value is 'none' "
+ "(i.e. nobody is able to send such messages).")}},
+ {db_type,
+ #{value => "mnesia | sql",
+ desc =>
+ ?T("Same as top-level 'default_db' option, but applied to this module only.")}},
+ {use_cache,
+ #{value => "true | false",
+ desc =>
+ ?T("Same as top-level 'use_cache' option, but applied to this module only.")}},
+ {cache_size,
+ #{value => "pos_integer() | infinity",
+ desc =>
+ ?T("Same as top-level 'cache_size' option, but applied to this module only.")}},
+ {cache_missed,
+ #{value => "true | false",
+ desc =>
+ ?T("Same as top-level 'cache_missed' option, but applied to this module only.")}},
+ {cache_life_time,
+ #{value => "timeout()",
+ desc =>
+ ?T("Same as top-level 'cache_life_time' option, but applied to this module only.")}}]}.