Skip to content
  • Melvin Keskin's avatar
    Do not fetch messages of locally removed chats from server via MAM · 03f16856
    Melvin Keskin authored
    The Latest message data is stored in the database for each account.
    
    Formerly, the message after that all offline messages were to be fetched
    was determined by taking the latest message from the messages database
    table.
    If more recent messages were exchanged but then locally removed because
    their corresponding chat was removed, the remaining latest message in the
    database was not the latest exchanged message anymore.
    That resulted in fetching the removed messages again instead of fetching
    all messages after the most recent message of the removed ones.
    
    The new approach avoids fetching messages of locally removed chats when the
    exchanged messages were more recent than the latest one that remained
    in the databse as well.
    Thus, removed roster items are not added again by Kaidan's automatic roster
    item addition on receiving the first message from an unknown JID when the
    messages exchanged with that JID are more recent than the ones in the
    messages database table after the local removal.
    
    Closes #466
    03f16856