diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.cpp | 20 | ||||
-rwxr-xr-x | src/svn-rev.sh | 2 | ||||
-rw-r--r-- | src/users.cpp | 2 |
3 files changed, 13 insertions, 11 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 1574ffc0b..41759f2e2 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -373,11 +373,11 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri log(DEBUG,"Passed channel checks"); - for (unsigned int index =0; index < user->chans.size(); index++) + for (std::vector<ucrec*>::const_iterator index = user->chans.begin(); index != user->chans.end(); index++) { - if (user->chans[index].channel == NULL) + if ((ucrec*)(*index)->channel == NULL) { - return ForceChan(Ptr,user->chans[index],user,created); + return ForceChan(Ptr,(ucrec*)(*index),user,created); } } @@ -444,7 +444,7 @@ chanrec* ForceChan(chanrec* Ptr,ucrec *a,userrec* user, int created) a->uc_modes = 0; } - a.channel = Ptr; + a->channel = Ptr; Ptr->AddUser(user); WriteChannel(Ptr,user,"JOIN :%s",Ptr->name); log(DEBUG,"Sent JOIN to client"); @@ -548,7 +548,7 @@ void server_kick_channel(userrec* user, chanrec* Ptr, char* reason, bool trigger for (unsigned int i =0; i < user->chans.size(); i++) { - if ((user->chans[i]->channel) && (user->chans[i]->channel->name == Ptr)) + if ((user->chans[i]->channel) && (user->chans[i]->channel == Ptr)) { WriteChannelWithServ(Config->ServerName,Ptr,"KICK %s %s :%s",Ptr->name, user->nick, reason); user->chans[i]->uc_modes = 0; @@ -627,15 +627,15 @@ void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason) } FOREACH_MOD(I_OnUserKick,OnUserKick(src,user,Ptr,reason)); - - for (unsigned int i =0; i < user->chans.size(); i++) + + for (std::vector<ucrec*>::const_iterator i = user->chans.begin(); i != user->chans.end(); i++) { /* zap it from the channel list of the user */ - if ((user->chans[i].channel) && (user->chans[i].channel == Ptr->name)) + if ((((ucrec*)(*i))->channel) && (((ucrec*)(*i))->channel == Ptr)) { WriteChannel(Ptr,src,"KICK %s %s :%s",Ptr->name, user->nick, reason); - user->chans[i].uc_modes = 0; - user->chans[i].channel = NULL; + ((ucrec*)(*i))->uc_modes = 0; + ((ucrec*)(*i))->channel = NULL; log(DEBUG,"del_channel: unlinked: %s %s",user->nick,Ptr->name); break; } diff --git a/src/svn-rev.sh b/src/svn-rev.sh index 168c57787..54b5c80eb 100755 --- a/src/svn-rev.sh +++ b/src/svn-rev.sh @@ -1 +1 @@ -echo 3575 +echo 3579 diff --git a/src/users.cpp b/src/users.cpp index 9bc006bbc..4db389957 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -117,6 +117,8 @@ userrec::userrec() for (unsigned int n = 0; n < MAXCHANS; n++) { clientlist[tempnick]->chans[n] = new ucrec(); + clientlist[tempnick]->chans[n]->channel = NULL; + clientlist[tempnick]->chans[n]->uc_modes = 0; } } |