• JC Brand's avatar
    Refactor MAM to fetch a limited number of newest messages first. Fixes #1810 · 8769b297
    JC Brand authored
    - Clarify types and distinguish between MAM query options and RSM query options.
    
    - Remove the `fetchMessagesOnScrollUp` event handler. Instead messages will be fetched as a placeholder comes into view.
    
    - Remove support for mam2:#extended querying
        It's too much of a headache with patchy server support.
        Instead, use RSM's `<before>some-id</before>` together with `start` to
        bracket queries for placeholders.
    
    - Create a placeholder after restoring cached messages.
        This placeholder will automatically fetch older messages when the user scrolls up.
    
    - Create new config option `auto_fill_history_gaps`
    
    - Don't duplicate already existing MAM placeholders.
        Pre-existing ones could have been created from the cache.
    
    - If we have a most recent message, query from it
    8769b297