Skip to content

xep0377: add report-origin, third-party and stanza-ids - #114

Merged
badlop merged 1 commit into
processone:masterfrom
sstrigler:xep0377_missing_parts
Oct 15, 2026
Merged

badlop merged 1 commit into
processone:masterfrom
sstrigler:xep0377_missing_parts

Conversation

@sstrigler

Copy link
Copy Markdown
Contributor

An example says more than ...

xmpp:decode(fxml_stream:parse_element(<<"<report xmlns='urn:xmpp:reporting:1' reason='urn:xmpp:reporting:abuse'><report-origin/><stanza-id  xmlns='urn:xmpp:sid:0' by='romeo@example.net' id='28482-98726-73623'/><text xml:lang='de'>hallo</text></report>">>)).
#report{reason = abuse,
        text = [#text{lang = <<"de">>,data = <<"hallo">>}],
        'report-origin' = true,'third-party' = false,
        'stanza-ids' = [#stanza_id{by = #jid{user = <<"romeo">>,
                                             server = <<"example.net">>,resource = <<>>,
                                             luser = <<"romeo">>,lserver = <<"example.net">>,
                                             lresource = <<>>},
                                   id = <<"28482-98726-73623">>}]}

@sstrigler

sstrigler commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Or should I be using underscores in attribute names, like third_party etc instead?

@badlop

badlop commented Oct 14, 2026

Copy link
Copy Markdown
Member

Looking at the xmpp_codec.spec file, the ref labels that have several words separate them with _, and none uses -. So, yes, better to use underscores in those ref labels, at least for coherence in that file.

The string used in the final XML is correctly set in

#elem{name = <<"third-party">>,

This implements missing parts of xep0377 as of v0.4.1.
@sstrigler
sstrigler force-pushed the xep0377_missing_parts branch from 025950e to 651759a Compare October 15, 2026 07:53
@sstrigler

Copy link
Copy Markdown
Contributor Author

Thanks, that's what I meant. I've updated the PR accordingly. Now it looks like this:

(ejabberd@localhost)3> xmpp:decode(fxml_stream:parse_element(<<"<report xmlns='urn:xmpp:reporting:1' reason='urn:xmpp:reporting:abuse'><report-origin/><stanza-id  xmlns='urn:xmpp:sid:0' by='romeo@example.net' id='28482-98726-73623'/><text xml:lang='de'>hallo</text></report>">>)).
#report{reason = abuse,
        text = [#text{lang = <<"de">>,data = <<"hallo">>}],
        report_origin = true,third_party = false,
        stanza_ids = [#stanza_id{by = #jid{user = <<"romeo">>,
                                           server = <<"example.net">>,resource = <<>>,
                                           luser = <<"romeo">>,lserver = <<"example.net">>,
                                           lresource = <<>>},
                                 id = <<"28482-98726-73623">>}]}

@sstrigler

Copy link
Copy Markdown
Contributor Author

Beware, maybe because I force pushed the automated make spec xdata didn't run.

Also for some odd reason CI is acting up. Should I just delete this PR and try with a new one?

@badlop

badlop commented Oct 15, 2026

Copy link
Copy Markdown
Member

Don't worry, let's merge, it may generate then, or can be made manually.

@badlop
badlop merged commit befd90c into processone:master Oct 15, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants