2008-07-09 Badlop <badlop@process-one.net>
+ * src/mod_register.erl: Support for io_lib newline character in
+ the body of welcome_message (EJAB-501)
+ * doc/guide.tex: Document the newline character
+ * src/ejabberd.cfg.example: Example usage of newline character
+
* src/ejabberd_config.erl (load_file): error message on sasl.log
is not flattened (EJAB-616)
author, subject and configuration.
</LI><LI CLASS="li-itemize">
The room JID in the generated HTML is a link to join the chatroom (using
-<A HREF="http://www.xmpp.org/rfc/rfc5122.html">XMPP URI</A>).
+<A HREF="http://www.xmpp.org/rfcs/rfc5122.html">XMPP URI</A>).
</LI><LI CLASS="li-itemize">Subject and chatroom configuration changes are tracked and displayed.
</LI><LI CLASS="li-itemize">Joins, leaves, nick changes, kicks, bans and ‘/me’ are tracked and
displayed, including the reason if available.
</DD><DT CLASS="dt-description"><B><TT>welcome_message</TT></B></DT><DD CLASS="dd-description"> Set a welcome message that
is sent to each newly registered account. The first string is the subject, and
the second string is the message body.
+In the body you can set a newline with the characters: <TT>~n</TT>.
</DD><DT CLASS="dt-description"><B><TT>registration_watchers</TT></B></DT><DD CLASS="dd-description"> This option defines a
list of JIDs which will be notified each time a new account is registered.
</DD><DT CLASS="dt-description"><B><TT>iqdisc</TT></B></DT><DD CLASS="dd-description"> This specifies
...
{mod_register,
[
- {welcome_message, {"Welcome!", "Welcome to this Jabber server. Check http://www.jabber.org"}},
+ {welcome_message, {"Welcome!", "Hi.~nWelcome to this Jabber server.~n Check http://www.jabber.org~n~nBye"}},
{registration_watchers, ["admin1@example.org", "boss@example.net"]}
]},
...
\titem{welcome\_message} \ind{options!welcomem}Set a welcome message that
is sent to each newly registered account. The first string is the subject, and
the second string is the message body.
+ In the body you can set a newline with the characters: \term{\~\ n}.
\titem{registration\_watchers} \ind{options!rwatchers}This option defines a
list of JIDs which will be notified each time a new account is registered.
\iqdiscitem{In-Band Registration (\ns{jabber:iq:register})}
...
{mod_register,
[
- {welcome_message, {"Welcome!", "Welcome to this Jabber server. Check http://www.jabber.org"}},
+ {welcome_message, {"Welcome!", "Hi.~nWelcome to this Jabber server.~n Check http://www.jabber.org~n~nBye"}},
{registration_watchers, ["admin1@example.org", "boss@example.net"]}
]},
...
%% a message with this subject and body.
%%
{welcome_message, {"Welcome!",
- "Welcome to this Jabber server."}},
+ "Hi.~nWelcome to this Jabber server."}},
%%
%% When a user registers, send a notification to
{"", ""} ->
ok;
{Subj, Body} ->
+ BodyFormatted = io_lib:format(Body, []),
ejabberd_router:route(
jlib:make_jid("", Host, ""),
JID,
{xmlelement, "message", [{"type", "normal"}],
[{xmlelement, "subject", [], [{xmlcdata, Subj}]},
- {xmlelement, "body", [], [{xmlcdata, Body}]}]});
+ {xmlelement, "body", [], [{xmlcdata, BodyFormatted}]}]});
_ ->
ok
end.