]> jfr.im git - solanum.git/blobdiff - extensions/m_webirc.c
Merge pull request #288 from edk0/umode-o-split
[solanum.git] / extensions / m_webirc.c
index 04f0c911b2f9a06f262fd9b069d3f392b24d5b93..2937189ea784496d2b5ac4b2006aca39db5a9595 100644 (file)
@@ -64,7 +64,14 @@ struct Message webirc_msgtab = {
 
 mapi_clist_av1 webirc_clist[] = { &webirc_msgtab, NULL };
 
-DECLARE_MODULE_AV2(webirc, NULL, NULL, webirc_clist, NULL, NULL, NULL, NULL, webirc_desc);
+static void new_local_user(void *data);
+mapi_hfn_list_av1 webirc_hfnlist[] = {
+       /* unintuitive but correct--we want to be called first */
+       { "new_local_user", (hookfn) new_local_user, HOOK_LOWEST },
+       { NULL, NULL }
+};
+
+DECLARE_MODULE_AV2(webirc, NULL, NULL, webirc_clist, NULL, webirc_hfnlist, NULL, NULL, webirc_desc);
 
 /*
  * mr_webirc - webirc message handler
@@ -102,7 +109,7 @@ mr_webirc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
        }
        if (!IsSSL(source_p) && aconf->flags & CONF_FLAGS_NEED_SSL)
        {
-               sendto_one(source_p, "NOTICE * :Your CGI:IRC block requires SSL");
+               sendto_one(source_p, "NOTICE * :Your CGI:IRC block requires TLS");
                return;
        }
 
@@ -168,3 +175,13 @@ mr_webirc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
 
        sendto_one(source_p, "NOTICE * :CGI:IRC host/IP set to %s %s", parv[3], parv[4]);
 }
+
+static void
+new_local_user(void *data)
+{
+       struct Client *source_p = data;
+       struct ConfItem *aconf = source_p->localClient->att_conf;
+
+       if (!irccmp(aconf->info.name, "webirc."))
+               exit_client(source_p, source_p, &me, "Cannot log in using a WEBIRC block");
+}