]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/message.cpp
cmode(), cflags(), cstatus() -> chanrec::GetStatusChar(), chanrec::GetStatusFlags...
[user/henk/code/inspircd.git] / src / message.cpp
index 6d5941f7e7ea5042eaa1d795e593b552c3c2d0cd..7a1811a63fc37920ccdac0eb1e525525eeaf3871 100644 (file)
@@ -97,89 +97,3 @@ int isnick(const char* n)
        return (p < NICKMAX - 1);
 }
 
-/* returns the status character for a given user on a channel, e.g. @ for op,
- * % for halfop etc. If the user has several modes set, the highest mode
- * the user has must be returned. */
-
-const char* cmode(userrec *user, chanrec *chan)
-{
-       if ((!user) || (!chan))
-       {
-               log(DEFAULT,"*** BUG *** cmode was given an invalid parameter");
-               return "";
-       }
-
-       for (std::vector<ucrec*>::const_iterator i = user->chans.begin(); i != user->chans.end(); i++)
-       {
-               if ((*i)->channel == chan)
-               {
-                       if (((*i)->uc_modes & UCMODE_OP) > 0)
-                       {
-                               return "@";
-                       }
-                       if (((*i)->uc_modes & UCMODE_HOP) > 0)
-                       {
-                               return "%";
-                       }
-                       if (((*i)->uc_modes & UCMODE_VOICE) > 0)
-                       {
-                               return "+";
-                       }
-                       return "";
-               }
-       }
-       return "";
-}
-
-int cflags(userrec *user, chanrec *chan)
-{
-       if ((!chan) || (!user))
-               return 0;
-
-       for (std::vector<ucrec*>::const_iterator i = user->chans.begin(); i != user->chans.end(); i++)
-       {
-               if ((*i)->channel == chan)
-               {
-                       return (*i)->uc_modes;
-               }
-       }
-       return 0;
-}
-
-/* returns the status value for a given user on a channel, e.g. STATUS_OP for
- * op, STATUS_VOICE for voice etc. If the user has several modes set, the
- * highest mode the user has must be returned. */
-
-int cstatus(userrec *user, chanrec *chan)
-{
-       if ((!chan) || (!user))
-       {
-               log(DEFAULT,"*** BUG *** cstatus was given an invalid parameter");
-               return 0;
-       }
-
-       if (is_uline(user->server))
-               return STATUS_OP;
-
-       for (std::vector<ucrec*>::const_iterator i = user->chans.begin(); i != user->chans.end(); i++)
-       {
-               if ((*i)->channel == chan)
-               {
-                       if (((*i)->uc_modes & UCMODE_OP) > 0)
-                       {
-                               return STATUS_OP;
-                       }
-                       if (((*i)->uc_modes & UCMODE_HOP) > 0)
-                       {
-                               return STATUS_HOP;
-                       }
-                       if (((*i)->uc_modes & UCMODE_VOICE) > 0)
-                       {
-                               return STATUS_VOICE;
-                       }
-                       return STATUS_NORMAL;
-               }
-       }
-       return STATUS_NORMAL;
-}
-