mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-28 17:38:54 +01:00
Merge pull request #608 from weiss/bare-jid-subscription
PubSub: Check for node subscription of bare JID
This commit is contained in:
commit
b47a27f3ac
@ -373,7 +373,8 @@ publish_item(Nidx, Publisher, PublishModel, MaxItems, ItemId, Payload) ->
|
|||||||
end,
|
end,
|
||||||
Affiliation = GenState#pubsub_state.affiliation,
|
Affiliation = GenState#pubsub_state.affiliation,
|
||||||
Subscribed = case PublishModel of
|
Subscribed = case PublishModel of
|
||||||
subscribers -> is_subscribed(SubState#pubsub_state.subscriptions);
|
subscribers -> is_subscribed(GenState#pubsub_state.subscriptions) orelse
|
||||||
|
is_subscribed(SubState#pubsub_state.subscriptions);
|
||||||
_ -> undefined
|
_ -> undefined
|
||||||
end,
|
end,
|
||||||
if not ((PublishModel == open) or
|
if not ((PublishModel == open) or
|
||||||
@ -738,8 +739,10 @@ get_items(Nidx, JID, AccessModel, PresenceSubscription, RosterGroup, _SubId, _RS
|
|||||||
GenState = get_state(Nidx, GenKey),
|
GenState = get_state(Nidx, GenKey),
|
||||||
SubState = get_state(Nidx, SubKey),
|
SubState = get_state(Nidx, SubKey),
|
||||||
Affiliation = GenState#pubsub_state.affiliation,
|
Affiliation = GenState#pubsub_state.affiliation,
|
||||||
Subscriptions = SubState#pubsub_state.subscriptions,
|
BareSubscriptions = GenState#pubsub_state.subscriptions,
|
||||||
Whitelisted = can_fetch_item(Affiliation, Subscriptions),
|
FullSubscriptions = SubState#pubsub_state.subscriptions,
|
||||||
|
Whitelisted = can_fetch_item(Affiliation, BareSubscriptions) orelse
|
||||||
|
can_fetch_item(Affiliation, FullSubscriptions),
|
||||||
if %%SubId == "", ?? ->
|
if %%SubId == "", ?? ->
|
||||||
%% Entity has multiple subscriptions to the node but does not specify a subscription ID
|
%% Entity has multiple subscriptions to the node but does not specify a subscription ID
|
||||||
%{error, ?ERR_EXTENDED(?ERR_BAD_REQUEST, "subid-required")};
|
%{error, ?ERR_EXTENDED(?ERR_BAD_REQUEST, "subid-required")};
|
||||||
|
Loading…
Reference in New Issue
Block a user