]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_list.c
Allow /ojoin !#channel/%#channel, if admin/halfop are enabled.
[irc/rqf/shadowircd.git] / modules / m_list.c
index f3581a5adb7d6acd879326fdf54b7b728f05e599..ba83d898fa763bf75af90f7d9b1f5f1af3ae74ae 100644 (file)
@@ -37,7 +37,7 @@
 #include "channel.h"
 #include "client.h"
 #include "hash.h"
-#include "irc_string.h"
+#include "match.h"
 #include "ircd.h"
 #include "numeric.h"
 #include "s_conf.h"
@@ -103,7 +103,6 @@ static void safelist_check_cliexit(hook_data_client_exit * hdata)
 }
 
 /* m_list()
- *      parv[0] = sender prefix
  *      parv[1] = channel
  *
  * XXX - With SAFELIST, do we really need to continue pacing?
@@ -124,21 +123,20 @@ static int m_list(struct Client *client_p, struct Client *source_p, int parc, co
        if (parc < 2 || !IsChannelName(parv[1]))
        {
                /* pace this due to the sheer traffic involved */
-               if (((last_used + ConfigFileEntry.pace_wait) > CurrentTime))
+               if (((last_used + ConfigFileEntry.pace_wait) > rb_current_time()))
                {
                        sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "LIST");
                        sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name);
                        return 0;
                }
                else
-                       last_used = CurrentTime;
+                       last_used = rb_current_time();
        }
 
        return mo_list(client_p, source_p, parc, parv);
 }
 
 /* mo_list()
- *      parv[0] = sender prefix
  *      parv[1] = channel
  */
 static int mo_list(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
@@ -249,7 +247,7 @@ static void safelist_client_instantiate(struct Client *client_p, struct ListClie
        s_assert(MyClient(client_p));
        s_assert(params != NULL);
 
-       self = MyMalloc(sizeof(struct ListClient));
+       self = rb_malloc(sizeof(struct ListClient));
 
        self->hash_indice = 0;
        self->users_min = params->users_min;
@@ -283,7 +281,7 @@ static void safelist_client_release(struct Client *client_p)
 
        rb_dlinkFindDestroy(client_p, &safelisting_clients);
 
-       MyFree(client_p->localClient->safelist_data);
+       rb_free(client_p->localClient->safelist_data);
 
        client_p->localClient->safelist_data = NULL;
 
@@ -324,7 +322,7 @@ static void safelist_channel_named(struct Client *source_p, const char *name)
                return;
        }
 
-       if (ShowChannel(source_p, chptr))
+       if (!SecretChannel(chptr) || IsMember(source_p, chptr))
                sendto_one(source_p, form_str(RPL_LIST), me.name, source_p->name, chptr->chname,
                           rb_dlink_list_length(&chptr->members),
                           chptr->topic == NULL ? "" : chptr->topic);