]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
A few more typedefs defined and put into use.
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 10 Apr 2006 20:38:26 +0000 (20:38 +0000)
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 10 Apr 2006 20:38:26 +0000 (20:38 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3866 e03df62e-2008-0410-955e-edbf42e46eb7

include/channels.h
include/users.h
src/channels.cpp

index 2445d1188213db8afa7faf20d2209cf11e42edab..76b60466887fe0ab6ac1b686a2cc7a386d2b4e5c 100644 (file)
@@ -87,6 +87,11 @@ typedef std::vector<InviteItem>      InviteList;
  */
 typedef std::map<userrec*,userrec*> CUList;
 
+/** Shorthand for CUList::iterator
+ */
+typedef CUList::iterator CUListIter;
+typedef CUList::const_iterator CUListConstIter;
+
 /** A list of custom modes parameters on a channel
  */
 typedef std::map<char,char*> CustomModeList;
@@ -286,4 +291,3 @@ void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason);
 void server_kick_channel(userrec* user, chanrec* Ptr, char* reason, bool triggerevents);
 
 #endif
-
index a5cba44b62f791c9152d8ff3478edd874abd654a..81ab1c844ce3c42d9f7c73790864c8d909b96530 100644 (file)
@@ -109,6 +109,10 @@ typedef std::vector<Invited> InvitedList;
  */
 typedef std::vector<ConnectClass> ClassVector;
 
+/** Typedef for the list of user-channel records for a user
+ */
+typedef std::vector<ucrec*> UserChanList;
+
 /** Holds all information about a user
  * This class stores all information about a user connected to the irc server. Everything about a
  * connection is stored here primarily, from the user's socket ID (file descriptor) through to the
@@ -160,7 +164,7 @@ class userrec : public connection
         */
        char modebits;
        
-       std::vector<ucrec*> chans;
+       UserChanList chans;
        
        /** The server the user is connected to.
         */
index 45a12ee7ad2c72f0f8577cc2d6a04f0df8233435..dc42ea651e71035f8fd63cd56bd38a8f734b7df1 100644 (file)
@@ -131,7 +131,8 @@ void chanrec::AddUser(userrec* user)
 
 unsigned long chanrec::DelUser(userrec* user)
 {
-       CUList::iterator a = internal_userlist.find(user);
+       CUListIter a = internal_userlist.find(user);
+       
        if (a != internal_userlist.end())
        {
                internal_userlist.erase(a);
@@ -139,8 +140,8 @@ unsigned long chanrec::DelUser(userrec* user)
                DelOppedUser(user);
                DelHalfoppedUser(user);
                DelVoicedUser(user);
-               return internal_userlist.size();
        }
+       
        return internal_userlist.size();
 }
 
@@ -156,7 +157,7 @@ void chanrec::AddOppedUser(userrec* user)
 
 void chanrec::DelOppedUser(userrec* user)
 {
-       CUList::iterator a = internal_op_userlist.find(user);
+       CUListIter a = internal_op_userlist.find(user);
        if (a != internal_op_userlist.end())
        {
                internal_op_userlist.erase(a);
@@ -171,11 +172,11 @@ void chanrec::AddHalfoppedUser(userrec* user)
 
 void chanrec::DelHalfoppedUser(userrec* user)
 {
-       CUList::iterator a = internal_halfop_userlist.find(user);
+       CUListIter a = internal_halfop_userlist.find(user);
+
        if (a != internal_halfop_userlist.end())
        {   
                internal_halfop_userlist.erase(a);
-               return; 
        }
 }
 
@@ -186,11 +187,11 @@ void chanrec::AddVoicedUser(userrec* user)
 
 void chanrec::DelVoicedUser(userrec* user)
 {
-       CUList::iterator a = internal_voice_userlist.find(user);
+       CUListIter a = internal_voice_userlist.find(user);
+       
        if (a != internal_voice_userlist.end())
        {
                internal_voice_userlist.erase(a);
-               return; 
        }
 }
 
@@ -370,7 +371,7 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri
 
        log(DEBUG,"Passed channel checks");
 
-       for (std::vector<ucrec*>::const_iterator index = user->chans.begin(); index != user->chans.end(); index++)
+       for (UserChanList::const_iterator index = user->chans.begin(); index != user->chans.end(); index++)
        {
                if ((*index)->channel == NULL)
                {
@@ -628,7 +629,7 @@ void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason)
 
        FOREACH_MOD(I_OnUserKick,OnUserKick(src,user,Ptr,reason));
                        
-       for (std::vector<ucrec*>::const_iterator i = user->chans.begin(); i != user->chans.end(); i++)
+       for (UserChanList::const_iterator i = user->chans.begin(); i != user->chans.end(); i++)
        {
                /* zap it from the channel list of the user */
                if ((*i)->channel && ((*i)->channel == Ptr))