]> jfr.im git - irc/quakenet/snircd.git/blame - doc/api/motd.txt
sync undernet upstream ircu changes.
[irc/quakenet/snircd.git] / doc / api / motd.txt
CommitLineData
189935b1 1The server has a Message of the Day (MOTD) which is often used for
2describing the Acceptable Usage Policy, where to get help if you have
3problems, and so on. Older versions of ircd had a lot of duplicated
4code, as well as some inefficiencies, all related to sending the
5MOTD. As of u2.10.11, there is an API specifically for MOTDs. This
6API caches the MOTDs in memory for efficiency. Sending a MOTD to a
7client is as simple as calling a single function.
8
9<function>
10void motd_init(void);
11
12This function initializes the MOTD subsystem. It will also read in
13the default MOTD (usually ircd.motd) and the remote MOTD (usually
14remote.motd) files.
15</function>
16
17<function>
18int motd_send(struct Client* cptr);
19
20This function sends an appropriate MOTD to the client specified by
21_cptr_. If _cptr_ is not a local client, the remote MOTD will be
22sent; otherwise, an attempt will be made to find a Motd entry in the
23configuration file that matches the client. If no Motd entry can be
24found, the default MOTD will be sent to the client. This function
25returns 0 for the convenience of other functions that must have an
26integer return value. </function>
27
28<function>
29void motd_signon(struct Client* cptr);
30
31This function is similar to motd_send(), described above, except that
32it will only send a message to the client indicating when the MOTD was
33last modified if the FEAT_NODEFAULTMOTD feature is set to TRUE.
34</function>
35
36<function>
37void motd_recache(void);
38
39The MOTD system will not automatically detect when MOTD files have
40been modified. This function causes the MOTD system to clear the MOTD
41cache and re-read the files.
42</function>
43
44<function>
45void motd_add(const char *hostmask, const char *path);
46
47This function is used to add a MOTD to be sent to clients possessing a
48given _hostmask_. If _hostmask_ is a numerical string, it is
49interpreted as a connection class.
50</function>
51
52<function>
53void motd_clear(void);
54
55This function clears the list of special MOTDs. Only the default MOTD
56and remote MOTD are not affected by this function.
57</function>
58
59<function>
60void motd_report(struct Client *to);
61
62The motd_report() function sends a list of the Motd entries stored in
63memory to the client specified by _to_. Access control should be
64handled by the caller.
65</function>
66
67<authors>
68Kev <klmitch@mit.edu>
69</authors>
70
71<changelog>
72[2001-6-15 Kev] Initial documentation of the MOTD interface.
73</changelog>