Privileges

Note

XEP-0356: Privileged Entity” only works for XMPP users using the same server as slidcord, e.g., eve@example.org on discord.example.org.

Setting up slidcord as a privileged entity (XEP-0356) is optional, but nice to have. It improves user experience with a few “cherry on top” features. By configuring your XMPP server such that slidcord is a privileged entity, slidcord can:

  • automatically add/remove “puppet contacts” from the XMPP roster of slidcord users,

  • reflect on the XMPP side messages sent by users via official Discord apps,

  • (if using HTTP Upload for attachments from Discord to XMPP) request upload slots on behalf of slidcord users, respecting any quota, retention, permission, or other policy set at the upload component level,

  • synchronize other actions done via official Discord apps, such as marking messages as read, using emoji reactions, retracting messages, sending files…

  • automatically add XMPP bookmarks (XEP-0402) for MUCs (XEP-0045).

Server-specific instructions

Prosŏdy

Install the mod_privilege community module with:

prosodyctl install --server=https://modules.prosody.im/rocks/ mod_privilege

In prosody.cfg.lua, add mod_privilege to the modules_enabled list, and declare slidcord privileges in the appropriate virtualhost block:

local _privileges = {
  roster = "both";       -- for adding/removing contacts from the users' rosters
  message = "outgoing";  -- for reflecting messages sent by the user themselve from official Discord apps
  iq = {
    ["http://jabber.org/protocol/pubsub"] = "both";      -- for PEP Bookmarks
    ["http://jabber.org/protocol/pubsub#owner"] = "set"; -- for Message Display Synchronization
    ["urn:xmpp:http:upload:0"] = "get";                  -- for HTTP Upload on behalf of users
  }
};

VirtualHost "example.org"
  privileged_entities = {
    ["discord.example.org"] = _privileges;
  }

Then either restart the prosody server, or reload the config. You might need to use mod_reload_component, and activate/deactivate hosts for all changes to be taken into account (restarting prosody is the easiest way to go).

ejabberd

acl:
  slidge_acl:
    server:
      - "discord.example.org"

access_rules:
  slidge_rule:
    - allow: slidge_acl

modules:
  mod_privilege:
    roster:
      both: slidge_rule
    message:
      outgoing: slidge_rule
    iq:
      "http://jabber.org/protocol/pubsub":
        both: slidge_rule
      "http://jabber.org/protocol/pubsub#owner":
        set: slidge_rule
      "urn:xmpp:http:upload:0":
        get: slidge_rule
  mod_roster:
    versioning: true

Next step

Learn about about slidcord’s configuration to tune its behaviour to your liking.