Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amp repositioning #314

Merged
merged 2 commits into from
Nov 24, 2014
Merged

Amp repositioning #314

merged 2 commits into from
Nov 24, 2014

Conversation

pzel
Copy link
Contributor

@pzel pzel commented Nov 19, 2014

XEP-0079 specifies the following work-flow for processing AMP-tagged messages:

2.2 Server Processing
Server operation is where the bulk of the work is performed. Upon receiving a message with an AMP
extension, the server performs the following flow:

  • Validate the semantics (E1, E2).
    • Determine the default behavior.
  • Process rules until condition is met.
  • If a condition is met, execute that rule's action
    If no conditions are met, perform "default" behavior for message
  • Execute determined action (UCE) (E3).

This PR moves AMP strategy resolution from the filter_packet hook to a new hook in ejabberd_c2s.
This hook (amp_check_packet) is run in the transistion between the session_established and session_established2 states. Checking AMP this early in the pipeline makes sure that no server-side effects (like user_send_packet) are triggered before the AMP strategy is decided.

Also, because http://xmpp.org/extensions/xep-0079.html#security is not implemented, mod_amp is disabled in the default ejabberd.cfg.

@mongoose-im
Copy link
Collaborator

travis is using test branch amp-repositioning from https://github.com/esl/ejabberd_tests/tree/amp-repositioning

@pzel
Copy link
Contributor Author

pzel commented Nov 19, 2014

ejabberd_tests has a separate branch for this pull request, but there are no changes from master.

@michalwski
Copy link
Contributor

I'm deleting this branch (from ejabberd_tests) as it is not up-to-date with master and sic_SUITE always fails.

michalwski added a commit that referenced this pull request Nov 24, 2014
@michalwski michalwski merged commit 181070e into master Nov 24, 2014
@pzel pzel deleted the amp-repositioning branch November 28, 2014 10:05
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.

3 participants