Skip to content

auto_join_private_chats has no effect #3954

@milahu

Description

@milahu

in my converse.js instance
i cannot join a private chat via the auto_join_private_chats config
but another JID can start a private chat with my converse.js instance

expected:
converse.js should
for each JID in auto_join_private_chats
add contact, request authorization, open chat window

issue 2:
in my converse.js instance
after i close a private chat, i can no longer open the private chat
but another JID can write a message
and then converse.js shows the private chat again
including the chat history

in the converse.js roster, i only see a groupchats section
but no section for private chats (no contact list)
so there is no way to start (or restore) a private chat from the GUI

use case:
i want to add a "contact via chat" page to my website
where anonymous users can chat with me (private chat) (milahu@localhost)
so i dont need groupchats at all
converse.js → prosodypidgin (or similar)
(todo: prosody should ask new anonymous users to solve a captcha)

version: converse.js b79d835

chat.html is based on demo/anonymous.html

chat.html
<!DOCTYPE html>
<!-- based on converse.js/demo/anonymous.html -->
<html lang="en">
<head>
  <title>Chat</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <!--
  <link rel="shortcut icon" type="image/ico" href="./lib/node_modules/converse.js/dist/images/favicon.ico"/>
  -->
  <!-- FIXME HTTP 404
  /images/header.jpg
  /images/logo/conversejs-filled.svg
  /dist/sounds/msg_received.ogg
  /dist/sounds/msg_received.mp3
  -->
  <link type="text/css" rel="stylesheet" media="screen" href="./lib/node_modules/converse.js/dist/website.min.css" />
  <!--
  <noscript><p><img src="//stats.opkode.com/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
  <script type="text/javascript" src="analytics.js"></script>
  -->
  <!--
  <link rel="manifest" href="/manifest.json">
  -->
  <link type="text/css" rel="stylesheet" media="screen" href="./lib/node_modules/converse.js/dist/converse.min.css" />
  <!--
  <script src="https://cdn.conversejs.org/3rdparty/libsignal-protocol.min.js"></script>
  <script src="./lib/node_modules/converse.js/dist/converse.min.js"></script>
  -->
  <script src="./libsignal-protocol.min.js"></script>
  <script src="./lib/node_modules/converse.js/dist/converse.js"></script>
</head>

<body id="page-top" data-spy="scroll" class="converse-website">
<section class="section-wrapper">
  <section id="intro" class="intro text-center" class="container">
    <div class="row">
      <div class="col-md-12 col-md-offset-2">
        <h1 class="brand-heading fade-in">
          <svg class="converse-svg-logo"
            xmlns:svg="http://www.w3.org/2000/svg"
            xmlns="http://www.w3.org/2000/svg"
            xmlns:xlink="http://www.w3.org/1999/xlink"
            viewBox="0 0 364 364">
          <title>Converse</title>
          <g class="cls-1" id="g904">
            <g data-name="Layer 2">
              <g data-name="Layer 7">
                <path
                  class="cls-3"
                  d="M221.46,103.71c0,18.83-29.36,18.83-29.12,0C192.1,84.88,221.46,84.88,221.46,103.71Z" />
                <path
                  class="cls-4"
                  d="M179.9,4.15A175.48,175.48,0,1,0,355.38,179.63,175.48,175.48,0,0,0,179.9,4.15Zm-40.79,264.5c-.23-17.82,27.58-17.82,27.58,0S138.88,286.48,139.11,268.65ZM218.6,168.24A79.65,79.65,0,0,1,205.15,174a12.76,12.76,0,0,0-6.29,4.65L167.54,222a1.36,1.36,0,0,1-2.46-.8v-35.8a2.58,2.58,0,0,0-3.06-2.53c-15.43,3-30.23,7.7-42.73,19.94-38.8,38-29.42,105.69,16.09,133.16a162.25,162.25,0,0,1-91.47-67.27C-3.86,182.26,34.5,47.25,138.37,25.66c46.89-9.75,118.25,5.16,123.73,62.83C265.15,120.64,246.56,152.89,218.6,168.24Z" />
              </g>
            </g>
          </g>
        </svg>
        <span class="brand-heading__text">
          <span>converse<span class="subdued">.js</span></span>
          <p class="byline">messaging freedom</p>
        </span>
        </h1>

        <h3 class="mt-5">Anonymous login demo</h3>
      </div>
    </div>
  </section>
</section>
</body>

<script>
  converse.initialize({

    // no effect?
    loglevel: 'debug',

    view_mode: 'overlayed', // roster = popup/modal
    // view_mode: 'embedded', // roster = fill
    // view_mode: 'fullscreen', // roster = sidebar

    // No point in logging out when we have auto_login as true.
    allow_logout: false,

    keepalive: true,

    play_sounds: true,

    strict_plugin_dependencies: false,

    authentication: 'anonymous',

    show_controlbox_by_default: true,

    show_desktop_notifications: true,

    show_self_in_roster: true,

    blacklisted_plugins: [
      // 'converse-muc', // multi user chat
      // 'converse-muc-embedded',
      // 'converse-roomslist',
    ],

    auto_login: true,

    jid: 'milahu.duckdns.org', // our XMPP ID (anonymous, random username)

    websocket_url: "wss://milahu.duckdns.org:5281/xmpp-websocket",

    // locked_domain: 'milahu.duckdns.org',

    // bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes

    // FIXME not working
    auto_join_private_chats: [
      // 'milahu@milahu.duckdns.org',
      'milahu@localhost',
    ],

    // Contacts from other servers cannot,
    // be added and anonymous users don't know one another's JIDs, so disabling.
    allow_contact_requests: false,

    // receive messages from users that are not in your roster
    allow_non_roster_messaging: true,

    // automatically subscribe back to any contact requests
    auto_subscribe: true,
  
    // disable XEP-0384: OMEMO Encryption
    // Messages are encrypted on the client
    // The server (Prosody) cannot read them
    // Supports multiple devices per user
    omemo_default: false,
    clear_cache_on_logout: true,

    // FIXME  ERROR: rooms.open: You need to provide at least one JID
    auto_join_rooms: [
      // [{'jid': 'room@milahu.duckdns.org', 'minimized': false }],
    ],

    notify_all_room_messages: [
    ],

    // muc_nickname_from_jid: true,
    // muc_domain: 'milahu.duckdns.org',
    // locked_muc_domain: 'milahu.duckdns.org',
    // Federation is disabled, so no use in showing the MUC server.
    hide_muc_server: true,
    // auto_join_on_invite: true, // automatically join a chatroom on invite without any confirm

    // Doesn't make sense to allow because only roster contacts can be invited
    allow_muc_invitations: false,

  });
</script>
</html>
/etc/prosody/prosody.cfg.lua
pidfile = "/run/prosody/prosody.pid"

log = "*syslog"

data_path = "/var/lib/prosody"
plugin_paths = {
}

ssl = {
  cafile = "/nix/store/xz51wpr8fwvyrwz32z7b13b229d1v8p6-nss-cacert-3.119.1/etc/ssl/certs/ca-bundle.crt";
  key = "/var/lib/acme/milahu.duckdns.org/key.pem";
  certificate = "/var/lib/acme/milahu.duckdns.org/fullchain.pem";
};

admins = { "admin@milahu.duckdns.org" }

modules_enabled = {
  "admin_shell";  -- for prosodyctl
  "bosh";
  "carbons";
  "csi";
  "disco";
  "http_files";
  "mam";
  "ping";
  "proxy65";
  "roster";
  "saslauth";
  "smacks";
  "time";
  "tls";
  "uptime";
  "version";
  "websocket";
};

disco_items = {
};

allow_registration = false

c2s_require_encryption = true

s2s_require_encryption = true
s2s_secure_auth = true
s2s_insecure_domains = {  }
s2s_secure_domains = {  }

authentication = "internal_hashed"

http_interfaces = { "*", "::" }
https_interfaces = { "*", "::" }

http_ports = { 5280 }
https_ports = { 5281 }

mime_types_file = "/nix/store/8r1dl5avizg0qs395d0rgbnynxmn6ybg-mailcap-2.1.54/etc/mime.types"

VirtualHost "localhost"
  enabled = true;
  authentication = "internal_hashed"

VirtualHost "milahu.duckdns.org"
  enabled = true;
  authentication = "anonymous"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions