]> jfr.im git - irc/unrealircd/unrealircd.git/commitdiff
Index: Changes
authorwolfsage <redacted>
Sat, 9 Jun 2007 19:15:18 +0000 (19:15 +0000)
committerwolfsage <redacted>
Sat, 9 Jun 2007 19:15:18 +0000 (19:15 +0000)
===================================================================
RCS file: /home/cmunk/ircsystems/cvsroot/unreal/Changes,v
retrieving revision 1.1.1.1.2.1.2.1.2.2422
diff -u -r1.1.1.1.2.1.2.1.2.2422 Changes
--- Changes 9 Jun 2007 18:00:05 -0000 1.1.1.1.2.1.2.1.2.2422
+++ Changes 9 Jun 2007 19:15:14 -0000
@@ -1745,3 +1745,4 @@
   directive which loads velcro modules
 - #0003382 reported by stealth regarding nested C-style comments messing
 - up example.conf parsing
+- #0003107 feature request by Sakkath regarding new WHO flag: +p <port>

Changes
src/modules/m_who.c

diff --git a/Changes b/Changes
index 7880f4629a491a13b8d281739a3393b9b8bfd3cf..e6ae5170661ae042015354b6ae4639a07acf4707 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1745,3 +1745,4 @@ MOTDs
   directive which loads velcro modules
 - #0003382 reported by stealth regarding nested C-style comments messing 
 - up example.conf parsing
+- #0003107 feature request by Sakkath regarding new WHO flag: +p <port>
index 3d2978e3818a84d2d8f454113a662ced094ee54e..c52ed4ec86815e483baba42b87ad05a34b09b3b3 100644 (file)
@@ -137,6 +137,8 @@ struct {
        char *user;
        int want_ip;
        char *ip;
+       int want_port;
+       int port;
        int want_umode;
        int umodes_dontwant;
        int umodes_want;
@@ -244,6 +246,8 @@ static void who_sendhelp(aClient *sptr)
     "                        wildcards accepted",
     "Flag i <ip>:            user has string <ip> in his/her IP address,",
     "                        wildcards accepted",
+    "Flag p <port>:          user is connecting on port <port>,",
+    "                        local connections only",
     "Flag m <usermodes>:     user has <usermodes> set",
     "Flag n <nick>:          user has string <nick> in his/her nickname,",
     "                        wildcards accepted",
@@ -370,6 +374,14 @@ int i = 1;
                                }
                                i++;
                                break;
+                       case 'p':
+                               REQUIRE_PARAM()
+                               if (!IsAnOper(sptr))
+                                       break; /* oper-only */
+                               wfl.port = atoi(argv[i]);
+                               SET_OPTION(wfl.want_port);
+                               i++;
+                               break;
                        case 'M':
                                SET_OPTION(wfl.common_channels_only);
                                break;
@@ -495,6 +507,23 @@ char has_common_chan = 0;
                        }
                }
 
+               /* if they only want people connecting on a certain port */
+               if (wfl.want_port != WHO_DONTCARE)
+               {
+                       int port;
+                       
+                       if (!MyClient(acptr))
+                               return WHO_CANTSEE;
+
+                       port = acptr->listener->port;
+
+                       if (((wfl.want_port == WHO_WANT) && wfl.port != port) ||
+                           ((wfl.want_port == WHO_DONTWANT) && wfl.port == port))
+                       {
+                               return WHO_CANTSEE;
+                       }
+               }
+
                /* if they only want people with a certain nick.. */
                if (wfl.want_nick != WHO_DONTCARE)
                {