Giter Site home page Giter Site logo

Comments (5)

jubalh avatar jubalh commented on June 11, 2024

OMEMO messages can only be decrypted once.
When Profanity receives such a message it decrypts it and stores it in the sqlite DB. When you quit Profanity and start it later again and join a MUC it will load the messages from this DB. There are some things that play into this as well like: MAM. The server I use supports MAM and I have MAM enabled in Profanity, the messages are shown correctly when I join a MUC again.

If you don't have MAM enabled we will receive the last X messages from the server again (limited amount, I forgot the exact number) when we join a MUC. They will be OMEMO encrypted too and we won't be able to decrypt them since it's only possible to do this once. Maybe you are seeing this? I'm not sure right now what we do in this case would have to check the code.

Can you make sure you have MAM enabled? Or use PG UP key to scroll up and (re)load messages from the DB?

from profanity.

wisheth avatar wisheth commented on June 11, 2024

MAM is enabled, but according to the documentation for /mam it's not supported for MUCs. Using PG UP doesn't load anything in these MUCs, even though I know there are previous messages.

from profanity.

jubalh avatar jubalh commented on June 11, 2024

Sorry I was confused.
MUC MAM is WIP here: #1862

from profanity.

jubalh avatar jubalh commented on June 11, 2024

@H3rnand3zzz didnt we implement that we load messages from DB when we scroll up even when MAM is not available?

from profanity.

H3rnand3zzz avatar H3rnand3zzz commented on June 11, 2024

@H3rnand3zzz didnt we implement that we load messages from DB when we scroll up even when MAM is not available?

The functionality always was there, take a look at a commented version:

        if (first_entry && !(first_entry->theme_item == THEME_ROOMINFO && g_strcmp0(first_entry->message, LOADING_MESSAGE) == 0)) { // if chat is not empty
            if (*scroll_state != WIN_SCROLL_REACHED_TOP) { // if we haven't reached top of the DB yet
                *scroll_state = !chatwin_db_history(chatwin, NULL, NULL, TRUE) ? WIN_SCROLL_REACHED_TOP : WIN_SCROLL_INNER; // update current reach_top_of_the_db state
            }

            if (*scroll_state == WIN_SCROLL_REACHED_TOP && prefs_get_boolean(PREF_MAM)) { // if we reached top of the DB, fetch MAM
                win_print_loading_history(window);
                iq_mam_request_older(chatwin);
            }

So, long tale short, the only time we fetch MAM now is when we reach top of the DB && MAM is enabled. But otherwise, MAM or not, we fetch the data from DB. Also as far as I remember, it always was kind of this way, just without reached_top state, so we always made (sometimes useless) DB request.

P.S. Sorry for the late response, please use other means of communications in the future.

from profanity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.