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

allow filtering moduels return modified packet in ejabberd_router:rou… #1076

Merged
merged 1 commit into from
Nov 14, 2016

Conversation

ludwikbukowski
Copy link
Contributor

@ludwikbukowski ludwikbukowski commented Nov 11, 2016

This PR addresses #1075

Proposed changes include:

  • Change in ejabberd_router:route/4 function so that it allows filtering modules change the packet and route it further

?DEBUG("filter passed", []),
case catch(M:route(OrigFrom, OrigTo, OrigPacket)) of
case catch(M:route(OrigFrom, OrigTo, OrigPacketFiltered)) of
{'EXIT', Reason} ->
?ERROR_MSG("error when routing from=~ts to=~ts in module=~p, reason=~p, packet=~ts, stack_trace=~p",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Elvis:

Line 462 is too long: ?ERROR_MSG("error when routing from=~ts to=~ts in module=~p, reason=~p, packet=~ts, stack_trace=~p",.

?DEBUG("filter passed", []),
case catch(M:route(OrigFrom, OrigTo, OrigPacket)) of
case catch(M:route(OrigFrom, OrigTo, OrigPacketFiltered)) of

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Elvis:

Remove the dynamic function call on line 460. Only modules that define callbacks should make dynamic calls.

@michalwski michalwski merged commit dda66c8 into master Nov 14, 2016
@michalwski michalwski deleted the routing-fix branch November 14, 2016 09:27
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