24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-04 21:27:16 +02:00

Rename mod_muc_log option spam_prevention to link_nofollow (EJAB-1141)

This commit is contained in:
Badlop 2010-04-21 18:58:03 +02:00
parent 069ad5332d
commit cb9b97411b
3 changed files with 13 additions and 18 deletions

View File

@ -2535,10 +2535,10 @@ The default value is <TT>html</TT>.
This option sets the full path to the directory in which the HTML files should
be stored. Make sure the <TT>ejabberd</TT> daemon user has write access on that
directory. The default value is <TT>"www/muc"</TT>.
</DD><DT CLASS="dt-description"><B><TT>{spam_prevention true|false}</TT></B></DT><DD CLASS="dd-description">
To prevent spam, the <TT>spam_prevention</TT> option adds a special attribute
</DD><DT CLASS="dt-description"><B><TT>{link_nofollow true|false}</TT></B></DT><DD CLASS="dd-description">
The option <TT>link_nofollow</TT> adds a special attribute
to links that prevent their indexation by search engines. The default value
is <TT>true</TT>, which mean that nofollow attributes will be added to user
is <TT>true</TT>, which means that <TT>nofollow</TT> attributes will be added to user
submitted links.
</DD><DT CLASS="dt-description"><B><TT>{timezone, local|universal}</TT></B></DT><DD CLASS="dd-description">
The time zone for the logs is configurable with this option. Allowed values
@ -2568,7 +2568,7 @@ time zone will be GMT/UTC. Finally, the top link will be
{dirname, room_jid},
{outdir, "/var/www/muclogs"},
{timezone, universal},
{spam_prevention, true},
{link_nofollow, true},
{top_link, {"http://www.jabber.ru/", "Jabber.ru"}}
]},
...

View File

@ -3255,10 +3255,10 @@ Options:
This option sets the full path to the directory in which the HTML files should
be stored. Make sure the \ejabberd{} daemon user has write access on that
directory. The default value is \term{"www/muc"}.
\titem{\{spam\_prevention true|false\}}\ind{options!spam\_prevention}
To prevent spam, the \term{spam\_prevention} option adds a special attribute
\titem{\{link\_nofollow true|false\}}\ind{options!link\_nofollow}
The option \term{link\_nofollow} adds a special attribute
to links that prevent their indexation by search engines. The default value
is \term{true}, which mean that nofollow attributes will be added to user
is \term{true}, which means that \term{nofollow} attributes will be added to user
submitted links.
\titem{\{timezone, local|universal\}}\ind{options!timezone}
The time zone for the logs is configurable with this option. Allowed values
@ -3291,7 +3291,7 @@ Examples:
{dirname, room_jid},
{outdir, "/var/www/muclogs"},
{timezone, universal},
{spam_prevention, true},
{link_nofollow, true},
{top_link, {"http://www.jabber.ru/", "Jabber.ru"}}
]},
...

View File

@ -63,7 +63,7 @@
access,
lang,
timezone,
spam_prevention,
link_nofollow,
top_link}).
%%====================================================================
@ -126,7 +126,7 @@ init([Host, Opts]) ->
AccessLog = gen_mod:get_opt(access_log, Opts, muc_admin),
Timezone = gen_mod:get_opt(timezone, Opts, local),
Top_link = gen_mod:get_opt(top_link, Opts, {"/", "Home"}),
NoFollow = gen_mod:get_opt(spam_prevention, Opts, true),
NoFollow = gen_mod:get_opt(link_nofollow, Opts, true),
Lang = case ejabberd_config:get_local_option({language, Host}) of
undefined ->
case ejabberd_config:get_global_option(language) of
@ -144,7 +144,7 @@ init([Host, Opts]) ->
access = AccessLog,
lang = list_to_binary(Lang),
timezone = Timezone,
spam_prevention = NoFollow,
link_nofollow = NoFollow,
top_link = Top_link}}.
%%--------------------------------------------------------------------
@ -321,7 +321,7 @@ add_message_to_log(Nick1, Message, RoomJID, Opts, State) ->
css_file = CSSFile,
lang = Lang,
timezone = Timezone,
spam_prevention = NoFollow,
link_nofollow = NoFollow,
top_link = TopLink} = State,
Room = get_room_info(RoomJID, Opts),
Nick = htmlize(Nick1, FileFormat),
@ -773,11 +773,6 @@ put_room_occupants(F, RoomOccupants, Lang, _FileFormat) ->
fw(F, "<div class=\"rcos\" id=\"o~p\" style=\"display: none;\" ><br/>~s</div>", [Now2, RoomOccupants]),
fw(F, "</div>").
%% htmlize
%% The default behaviour is to ignore the nofollow spam prevention on links
%% (NoFollow=false)
htmlize(S1) ->
htmlize(S1, html).
@ -786,7 +781,7 @@ htmlize(S1, plaintext) ->
htmlize(S1, FileFormat) ->
htmlize(S1, false, FileFormat).
%% The NoFollow parameter tell if the spam prevention should be applied to the link found
%% The NoFollow parameter tell if the 'nofollow' attribute must be added to the link.
%% true means 'apply nofollow on links'.
htmlize(S1, _NoFollow, plaintext) ->
S1;