]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Restore and update send_oper_motd().
authorJilles Tjoelker <redacted>
Wed, 2 Apr 2008 23:16:49 +0000 (01:16 +0200)
committerJilles Tjoelker <redacted>
Wed, 2 Apr 2008 23:16:49 +0000 (01:16 +0200)
The main ircd binary now compiles and links.

src/cache.c

index e034580c63bce5cdbe0f48288b80a74630122da0..eab5db83d5ea451b988d2f21a70b3e56b3c99f13 100644 (file)
@@ -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);
+}