#1176 max_history_messages setting does not work for values higher than 20.

Reporter Damian Minkov
Owner Zash
Created
Updated
Stars ★ (1)
Tags
  • Component-Docs
  • Status-Fixed
  • Type-Defect
  • Priority-Medium
  1. Damian Minkov on

    What steps will reproduce the problem? 1. Set max_history_messages = 100; under the muc component What is the expected output? Muc to keep 100 messages. What do you see instead? It keeps the default of 20. What version of the product are you using? On what operating system? 0.10 and trunk. local default_history_length = 20; local max_history_length = module:get_option_number("max_history_messages", math.huge); local function get_historylength(room) return math.min(room._data.history_length or default_history_length, max_history_length); end So if there is no setting in the room data form, the code will get the minimum of default_history_length(=20) and the setting provided max_history_messages(=100). So basically you cannot increase the messages to be kept in the room.

  2. Damian Minkov on

    I was playing a little with 0.10 code and even changing the default doesn't work. As we do not modify the default config for the room. And there is this code that always defaults to 20 messages: if not history_tag then maxstanzas = 20; end This is in: function room_mt:send_history(to, stanza) Maybe it is different, the storing and initial sending ... But what is the point of storing more than it will be sent to the user ...

  3. Zash on

    Thanks for the report! I believe this is a misunderstanding or a documentation problem. TL;DR: You need to change a setting in each room. The setting `max_history_messages` specifies a limit on what each room can be configured to keep. It defaults to infinity, ie no limit. However each room still defaults to 20 messages kept. Some clients let you open a configuration dialog for rooms, eg in Pidgin you type `/configure`. In this dialog, you can change how many messages to keep with a setting called "Maximum Number of History Messages Returned by Room". Also, when a client joins, it can specify how much history it wants. See <https://xmpp.org/extensions/xep-0045.html#enter-managehistory>. If a client does not specify an amount, a default (20) is used. In recent trunk, a separate room setting 'Default Number of History Messages Returned by Room' lets you change that. The documentation says: > Maximum number of history messages that will be sent to the member that has just joined the room. This does seem confusing, I will see about improving it. Does this clarification help?

    Changes
    • owner Zash
    • tags Component-Docs Status-NeedInfo
  4. Zash on

    Is this https://hg.prosody.im/site/rev/cb494c946d5e enough to consider this closed?

  5. Damian Minkov on

    Yes, close it :) Thanks for the long explanations.

  6. Zash on

    Thanks.

    Changes
    • tags Status-Fixed

New comment

Not published. Used for spam prevention and optional update notifications.