Search code examples
ejabberdconverse.js

Remove user is online/offline notifications


I am using conversejs with an ejabberd xmpp server backend. I am trying to find a way to disable the user is online / user is offline messages from appearing within chats between users. The number of reconnections people are going through are clogging up the message box to the point that it's causing issues with users. The is online and is offline notifications aren't necessary for what I'm using the chat for, so I was wondering if there is an initialization option I'm missing to disable them or another workaround. The initialization options I'm using currently are:

        bosh_service_url: 'xxxxxxx',
        view_mode: 'overlayed',
        message_archiving: 'always',
        auto_login: true,
        auto_reconnect: true,
        credentials_url: 'xxxxxxx',
        clear_cache_on_logout: true,
        notify_all_room_messages: true,
        play_sounds: true,
        allow_contact_removal: false,
        allow_logout: false,
        allow_muc_invitations: false,
        allow_registration: false,
        allow_contact_requests: false,
        send_chat_state_notifications: false,
        show_tab_notifications: false,
        clear_messages_on_reconnection: true,
        idle_presence_timeout: 0

Solution

  • Disclaimer: I know almost nothing about Converse. I'm learning now how to use it with ejabberd, I got curious about your comment, investigated, and share my results:

    Looking at the Converse source code, it seems the text shown in the chat window is prepared here:

    https://github.com/conversejs/converse.js/blob/6ee3ddbc8c41608cf56d86566d6460bb423892b0/src/headless/plugins/chat/model.js#L323

    and that function is only called here:

    https://github.com/conversejs/converse.js/blob/6ee3ddbc8c41608cf56d86566d6460bb423892b0/src/headless/plugins/chat/model.js#L67

    As you can see, all this has only one condition: that it's a private chat. There's no check about other options or conditions... so it seems not configurable.

    Another bad news: I found no issue or feature request about this. The closest thing is this one related to MUC rooms: https://github.com/conversejs/converse.js/issues/1260

    The good news: if you can modify the source code, compile converse and offer that patched version to your users, you can disable those messages by brute force in your server.