]> git.lizzy.rs Git - minetest.git/blobdiff - src/chat.h
Add warning when disabling secure.enable_security (#9943)
[minetest.git] / src / chat.h
index b1b3edcb093007d7e5d10068ba2d7ce093a10f03..f84ece206c4fc0cb75adc236cf380c6653ae44d9 100644 (file)
@@ -77,7 +77,7 @@ class ChatBuffer
 
        // Append chat line
        // Removes oldest chat line if scrollback size is reached
-       void addLine(std::wstring name, std::wstring text);
+       void addLine(const std::wstring &name, const std::wstring &text);
 
        // Remove all chat lines
        void clear();
@@ -119,7 +119,7 @@ class ChatBuffer
        u32 formatChatLine(const ChatLine& line, u32 cols,
                        std::vector<ChatFormattedLine>& destination) const;
 
-    void resize(u32 scrollback);
+       void resize(u32 scrollback);
 protected:
        s32 getTopScrollPos() const;
        s32 getBottomScrollPos() const;
@@ -153,7 +153,7 @@ class ChatPrompt
        void input(const std::wstring &str);
 
        // Add a string to the history
-       void addToHistory(std::wstring line);
+       void addToHistory(const std::wstring &line);
 
        // Get current line
        std::wstring getLine() const { return m_line; }
@@ -165,7 +165,7 @@ class ChatPrompt
        void clear();
 
        // Replace the current line with the given text
-       std::wstring replace(std::wstring line);
+       std::wstring replace(const std::wstring &line);
 
        // Select previous command from history
        void historyPrev();
@@ -256,7 +256,7 @@ class ChatBackend
        ~ChatBackend() = default;
 
        // Add chat message
-       void addMessage(std::wstring name, std::wstring text);
+       void addMessage(const std::wstring &name, std::wstring text);
        // Parse and add unparsed chat message
        void addUnparsedMessage(std::wstring line);
 
@@ -265,7 +265,7 @@ class ChatBackend
        // Get the recent messages buffer
        ChatBuffer& getRecentBuffer();
        // Concatenate all recent messages
-       EnrichedString getRecentChat();
+       EnrichedString getRecentChat() const;
        // Get the console prompt
        ChatPrompt& getPrompt();
 
@@ -283,9 +283,9 @@ class ChatBackend
        void scrollPageDown();
        void scrollPageUp();
 
-    // Resize recent buffer based on settings
-    void applySettings(Settings* settings);
-    
+       // Resize recent buffer based on settings
+       void applySettings();
+
 private:
        ChatBuffer m_console_buffer;
        ChatBuffer m_recent_buffer;