Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

also send XEP-0425 moderation so Dino (and similar clients) delete locally. #11

Description

@github-actions

Requires bridge component JID to be a MUC moderator.

# Option 1 hack: also send XEP-0425 moderation so Dino (and similar clients) delete locally.
# Requires bridge component JID to be a MUC moderator.

    logger.info("XMPP retraction bridged: room={} author={} message={}", room_jid, nick, target_msg_id)
    comp._bus.publish("xmpp", evt)

    # Option 1 hack: also send XEP-0425 moderation so Dino (and similar clients) delete locally.
    # Requires bridge component JID to be a MUC moderator.
    if cfg.xmpp_promote_retraction_to_moderation and target_msg_id:
        comp._recently_moderated_by_us[dedupe_key] = None
        task = asyncio.create_task(_send_moderation_for_retraction(comp, room_jid, target_msg_id))
        comp._moderation_tasks.add(task)
        task.add_done_callback(comp._moderation_tasks.discard)


def on_moderated_message(comp: XMPPComponent, msg: Any) -> None:
    """Handle XEP-0425 moderator retraction; emit delete to bus."""
    from_jid = str(msg["from"]) if msg["from"] else ""
    # XEP-0425 §5: only moderation from the MUC service (bare room JID) is legitimate
    if "/" in from_jid:
        return  # From occupant; discard (spoofing)
    room_jid = from_jid
    if not room_jid:
        return

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions