]> jfr.im git - solanum.git/blobdiff - src/channel.c
CurrentTime -> rb_currenttime();
[solanum.git] / src / channel.c
index 4dc13cb6396dd1bbe4c6377195f0a2edc8ec969a..183a4e34fba42a724fb6da2cddd862dfadafb758 100644 (file)
@@ -25,7 +25,6 @@
  */
 
 #include "stdinc.h"
-#include "tools.h"
 #include "channel.h"
 #include "client.h"
 #include "common.h"
@@ -41,9 +40,6 @@
 #include "whowas.h"
 #include "s_conf.h"            /* ConfigFileEntry, ConfigChannel */
 #include "s_newconf.h"
-#include "event.h"
-#include "memory.h"
-#include "balloc.h"
 #include "s_log.h"
 
 extern rb_dlink_list global_channel_list;
@@ -93,14 +89,14 @@ allocate_channel(const char *chname)
 {
        struct Channel *chptr;
        chptr = BlockHeapAlloc(channel_heap);
-       DupString(chptr->chname, chname);
+       chptr->chname = rb_strdup(chname);
        return (chptr);
 }
 
 void
 free_channel(struct Channel *chptr)
 {
-       MyFree(chptr->chname);
+       rb_free(chptr->chname);
        BlockHeapFree(channel_heap, chptr);
 }
 
@@ -109,8 +105,8 @@ allocate_ban(const char *banstr, const char *who)
 {
        struct Ban *bptr;
        bptr = BlockHeapAlloc(ban_heap);
-       DupString(bptr->banstr, banstr);
-       DupString(bptr->who, who);
+       bptr->banstr = rb_strdup(banstr);
+       bptr->who = rb_strdup(who);
 
        return (bptr);
 }
@@ -118,8 +114,8 @@ allocate_ban(const char *banstr, const char *who)
 void
 free_ban(struct Ban *bptr)
 {
-       MyFree(bptr->banstr);
-       MyFree(bptr->who);
+       rb_free(bptr->banstr);
+       rb_free(bptr->who);
        BlockHeapFree(ban_heap, bptr);
 }
 
@@ -246,7 +242,7 @@ remove_user_from_channel(struct membership *msptr)
        if(client_p->servptr == &me)
                rb_dlinkDelete(&msptr->locchannode, &chptr->locmembers);
 
-       chptr->users_last = CurrentTime;
+       chptr->users_last = rb_current_time();
 
        if(!(chptr->mode.mode & MODE_PERMANENT) && rb_dlink_list_length(&chptr->members) <= 0)
                destroy_channel(chptr);
@@ -283,7 +279,7 @@ remove_user_from_channels(struct Client *client_p)
                if(client_p->servptr == &me)
                        rb_dlinkDelete(&msptr->locchannode, &chptr->locmembers);
 
-               chptr->users_last = CurrentTime;
+               chptr->users_last = rb_current_time();
 
                if(!(chptr->mode.mode & MODE_PERMANENT) && rb_dlink_list_length(&chptr->members) <= 0)
                        destroy_channel(chptr);
@@ -788,7 +784,7 @@ can_join(struct Client *source_p, struct Channel *chptr, char *key)
        /* join throttling stuff --nenolod */
        else if(chptr->mode.join_num > 0 && chptr->mode.join_time > 0)
        {
-               if ((CurrentTime - chptr->join_delta <= 
+               if ((rb_current_time() - chptr->join_delta <= 
                        chptr->mode.join_time) && (chptr->join_count >=
                        chptr->mode.join_num))
                        i = ERR_THROTTLE;
@@ -946,7 +942,7 @@ check_spambot_warning(struct Client *source_p, const char *name)
        else
        {
                if((t_delta =
-                   (CurrentTime - source_p->localClient->last_leave_time)) >
+                   (rb_current_time() - source_p->localClient->last_leave_time)) >
                   JOIN_LEAVE_COUNT_EXPIRE_TIME)
                {
                        decrement_count = (t_delta / JOIN_LEAVE_COUNT_EXPIRE_TIME);
@@ -957,7 +953,7 @@ check_spambot_warning(struct Client *source_p, const char *name)
                }
                else
                {
-                       if((CurrentTime -
+                       if((rb_current_time() -
                            (source_p->localClient->last_join_time)) < GlobalSetOptions.spam_time)
                        {
                                /* oh, its a possible spambot */
@@ -965,9 +961,9 @@ check_spambot_warning(struct Client *source_p, const char *name)
                        }
                }
                if(name != NULL)
-                       source_p->localClient->last_join_time = CurrentTime;
+                       source_p->localClient->last_join_time = rb_current_time();
                else
-                       source_p->localClient->last_leave_time = CurrentTime;
+                       source_p->localClient->last_leave_time = rb_current_time();
        }
 }