From de0ae50d20ee023969d0251493f7cfa41b023ac2 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Thu, 3 Apr 2008 01:16:49 +0200 Subject: [PATCH] Restore and update send_oper_motd(). The main ircd binary now compiles and links. --- src/cache.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/cache.c b/src/cache.c index e034580..eab5db8 100644 --- a/src/cache.c +++ b/src/cache.c @@ -288,3 +288,33 @@ cache_user_motd(void) free_cachefile(user_motd); user_motd = cache_file(MPATH, "ircd.motd", 0); } + + +/* send_oper_motd() + * + * inputs - client to send motd to + * outputs - client is sent oper motd if exists + * side effects - + */ +void +send_oper_motd(struct Client *source_p) +{ + struct cacheline *lineptr; + rb_dlink_node *ptr; + + if(oper_motd == NULL || rb_dlink_list_length(&oper_motd->contents) == 0) + return; + + sendto_one(source_p, form_str(RPL_OMOTDSTART), + me.name, source_p->name); + + RB_DLINK_FOREACH(ptr, oper_motd->contents.head) + { + lineptr = ptr->data; + sendto_one(source_p, form_str(RPL_OMOTD), + me.name, source_p->name, lineptr->data); + } + + sendto_one(source_p, form_str(RPL_ENDOFOMOTD), + me.name, source_p->name); +}