]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_serialize_rfc.cpp
Improve the message sent when overriding channel modes.
[user/henk/code/inspircd.git] / src / coremods / core_serialize_rfc.cpp
index 23a4c205276ce61c188304e00bbd9ed06fda4ec3..dcd67d49e041c1061d05dd25913022a87739c8ed 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2018-2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2018 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
@@ -32,7 +33,7 @@ class RFCSerializer : public ClientProtocol::Serializer
        static const std::string::size_type MAX_CLIENT_MESSAGE_TAG_LENGTH = 4095;
 
        /** The maximum size of server-originated message tags in an outgoing message including the `@`. */
-       static const std::string::size_type MAX_SERVER_MESSAGE_TAG_LENGTH = 511;
+       static const std::string::size_type MAX_SERVER_MESSAGE_TAG_LENGTH = 4095;
 
        static void SerializeTags(const ClientProtocol::TagMap& tags, const ClientProtocol::TagSelection& tagwl, std::string& line);
 
@@ -59,7 +60,7 @@ bool RFCSerializer::Parse(LocalUser* user, const std::string& line, ClientProtoc
        // Work out how long the message can actually be.
        size_t maxline = ServerInstance->Config->Limits.MaxLine - start - 2;
        if (line[start] == '@')
-               maxline += MAX_CLIENT_MESSAGE_TAG_LENGTH + 1; 
+               maxline += MAX_CLIENT_MESSAGE_TAG_LENGTH + 1;
 
        irc::tokenstream tokens(line, start, maxline);
        ServerInstance->Logs->Log("USERINPUT", LOG_RAWIO, "C[%s] I %s", user->uuid.c_str(), tokens.GetMessage().c_str());
@@ -88,7 +89,7 @@ bool RFCSerializer::Parse(LocalUser* user, const std::string& line, ClientProtoc
                while (ss.GetToken(token))
                {
                        // Two or more tags with the same key must not be sent, but if a client violates that we accept
-                       // the first occurence of duplicate tags and ignore all later occurences.
+                       // the first occurrence of duplicate tags and ignore all later occurrences.
                        //
                        // Another option is to reject the message entirely but there is no standard way of doing that.
                        const std::string::size_type p = token.find('=');