-
Notifications
You must be signed in to change notification settings - Fork 429
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
Add host_type to hook calls in core modules #3097
Changes from all commits
d2ddf6b
d317c2e
8f0abd4
95c6e1e
2c5ab01
9a5174c
e3aa84a
8822067
480c5ea
abe1930
a2cf4e7
7d31c08
ae743ea
38a5fb7
9afd2d0
530c21c
c6ba765
0925ddd
6348b76
e677477
c376aed
1a47fea
2319c9b
fe91830
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
stop/1, | ||
anonymous_user_exist/2, | ||
allow_multiple_connections/1, | ||
register_connection/4, | ||
register_connection/5, | ||
unregister_connection/5, | ||
session_cleanup/5 | ||
]). | ||
|
@@ -153,13 +153,14 @@ remove_connection(SID, LUser, LServer) -> | |
|
||
%% @doc Register connection | ||
-spec register_connection(Acc, | ||
HostType :: binary(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have this type defined in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've seen it. I don't think it makes sense to amend this PR though. I'd rather do it later. |
||
SID :: ejabberd_sm:sid(), | ||
JID :: jid:jid(), | ||
Info :: list()) -> Acc when Acc :: any(). | ||
register_connection(Acc, SID, #jid{luser = LUser, lserver = LServer}, Info) -> | ||
register_connection(Acc, HostType, SID, #jid{luser = LUser, lserver = LServer}, Info) -> | ||
case lists:keyfind(auth_module, 1, Info) of | ||
{_, ?MODULE} -> | ||
mongoose_hooks:register_user(LServer, LUser), | ||
mongoose_hooks:register_user(HostType, LServer, LUser), | ||
US = {LUser, LServer}, | ||
mnesia:sync_dirty( | ||
fun() -> mnesia:write(#anonymous{us = US, sid=SID}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it could be
remove_user(Acc, LServer, LUser)
. Though backward compatibility would suffer.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather rearrange the hook arguments in a separate PR as these changes are quite tricky.
As I said in the PR description: Do not rearrange the arguments when not necessary.