]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_websocket.cpp
Only assign NewServices once the duplicate check is done.
[user/henk/code/inspircd.git] / src / modules / m_websocket.cpp
index 5f0f9bcc83e85400e54b2ea9671f8c3e9a23e867..e2b0ee30ad8d4b08217f0e159ca5952175cc033b 100644 (file)
@@ -1,7 +1,9 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2019 iwalkalone <iwalkalone69@gmail.com>
+ *   Copyright (C) 2017-2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2016-2017 Attila Molnar <attilamolnar@hush.com>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
  * redistribute it and/or modify it under the terms of the GNU General Public
@@ -363,10 +365,10 @@ class WebSocketHook : public IOHookMiddle
 
                        for (WebSocketConfig::ProxyRanges::const_iterator iter = config.proxyranges.begin(); iter != config.proxyranges.end(); ++iter)
                        {
-                               if (InspIRCd::MatchCIDR(*iter, luser->GetIPString(), ascii_case_insensitive_map))
+                               if (InspIRCd::MatchCIDR(luser->GetIPString(), *iter, ascii_case_insensitive_map))
                                {
                                        // Give the user their real IP address.
-                                       if (realsa == luser->client_sa)
+                                       if (realsa != luser->client_sa)
                                                luser->SetClientIP(realsa);
                                        break;
                                }
@@ -548,7 +550,7 @@ class ModuleWebSocket : public Module
 
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("Provides RFC 6455 WebSocket support", VF_VENDOR);
+               return Version("Allows WebSocket clients to connect to the IRC server.", VF_VENDOR);
        }
 };