mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +01:00
typo fix on mod_pubsub and improve ejabberd_sm:get_session_pid api
SVN Revision: 2715
This commit is contained in:
parent
1fea1e3f4e
commit
2078f9ae95
@ -223,9 +223,10 @@ close_session_unset_presence(SID, JID, Status) when ?IS_JID(JID) ->
|
|||||||
Status]).
|
Status]).
|
||||||
|
|
||||||
get_session_pid(JID) when ?IS_JID(JID) ->
|
get_session_pid(JID) when ?IS_JID(JID) ->
|
||||||
USR = {exmpp_jid:prep_node(JID),
|
get_session_pid({exmpp_jid:prep_node(JID),
|
||||||
exmpp_jid:prep_domain(JID),
|
exmpp_jid:prep_domain(JID),
|
||||||
exmpp_jid:prep_resource(JID)},
|
exmpp_jid:prep_resource(JID)});
|
||||||
|
get_session_pid(USR) ->
|
||||||
case catch mnesia:dirty_index_read(session, USR, #session.usr) of
|
case catch mnesia:dirty_index_read(session, USR, #session.usr) of
|
||||||
[#session{sid = {_, Pid}}] -> Pid;
|
[#session{sid = {_, Pid}}] -> Pid;
|
||||||
_ -> none
|
_ -> none
|
||||||
|
@ -1215,7 +1215,7 @@ iq_pubsub(Host, ServerHost, From, IQType, SubEl, Lang) ->
|
|||||||
iq_pubsub(Host, ServerHost, From, IQType, SubEl, Lang, Access, Plugins) ->
|
iq_pubsub(Host, ServerHost, From, IQType, SubEl, Lang, Access, Plugins) ->
|
||||||
case exmpp_xml:remove_cdata_from_list(SubEl#xmlel.children) of
|
case exmpp_xml:remove_cdata_from_list(SubEl#xmlel.children) of
|
||||||
[#xmlel{name = Name, attrs = Attrs, children = Els} | Rest] ->
|
[#xmlel{name = Name, attrs = Attrs, children = Els} | Rest] ->
|
||||||
Node = string_to_node(exmpp_xml:get_attribute_from_list_as_list(attrs, 'node', false)),
|
Node = string_to_node(exmpp_xml:get_attribute_from_list_as_list(Attrs, 'node', false)),
|
||||||
case {IQType, Name} of
|
case {IQType, Name} of
|
||||||
{set, 'create'} ->
|
{set, 'create'} ->
|
||||||
Config = case Rest of
|
Config = case Rest of
|
||||||
@ -3151,7 +3151,7 @@ broadcast_stanza(Host, Node, _NodeId, _Type, NodeOptions, SubsByDepth, NotifyTyp
|
|||||||
_ ->
|
_ ->
|
||||||
LResource
|
LResource
|
||||||
end,
|
end,
|
||||||
case ejabberd_sm:get_session_pid(LUser, LServer, SenderResource) of
|
case ejabberd_sm:get_session_pid({LUser, LServer, SenderResource}) of
|
||||||
C2SPid when is_pid(C2SPid) ->
|
C2SPid when is_pid(C2SPid) ->
|
||||||
%% set the from address on the notification to the bare JID of the account owner
|
%% set the from address on the notification to the bare JID of the account owner
|
||||||
%% Also, add "replyto" if entity has presence subscription to the account owner
|
%% Also, add "replyto" if entity has presence subscription to the account owner
|
||||||
|
@ -2961,7 +2961,7 @@ broadcast_stanza(Host, Node, _NodeId, _Type, NodeOptions, SubsByDepth, NotifyTyp
|
|||||||
_ ->
|
_ ->
|
||||||
LResource
|
LResource
|
||||||
end,
|
end,
|
||||||
case ejabberd_sm:get_session_pid(LUser, LServer, SenderResource) of
|
case ejabberd_sm:get_session_pid({LUser, LServer, SenderResource}) of
|
||||||
C2SPid when is_pid(C2SPid) ->
|
C2SPid when is_pid(C2SPid) ->
|
||||||
%% set the from address on the notification to the bare JID of the account owner
|
%% set the from address on the notification to the bare JID of the account owner
|
||||||
%% Also, add "replyto" if entity has presence subscription to the account owner
|
%% Also, add "replyto" if entity has presence subscription to the account owner
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
--- mod_pubsub.erl 2009-10-27 15:19:20.000000000 +0100
|
--- mod_pubsub.erl 2009-10-27 15:30:13.000000000 +0100
|
||||||
+++ mod_pubsub_odbc.erl 2009-10-27 15:21:49.000000000 +0100
|
+++ mod_pubsub_odbc.erl 2009-10-27 15:30:21.000000000 +0100
|
||||||
@@ -42,7 +42,7 @@
|
@@ -42,7 +42,7 @@
|
||||||
%%% 6.2.3.1, 6.2.3.5, and 6.3. For information on subscription leases see
|
%%% 6.2.3.1, 6.2.3.5, and 6.3. For information on subscription leases see
|
||||||
%%% XEP-0060 section 12.18.
|
%%% XEP-0060 section 12.18.
|
||||||
@ -398,15 +398,6 @@
|
|||||||
end,
|
end,
|
||||||
case transaction(Host, Node, Action, sync_dirty) of
|
case transaction(Host, Node, Action, sync_dirty) of
|
||||||
{result, {_, Result}} -> {result, Result};
|
{result, {_, Result}} -> {result, Result};
|
||||||
@@ -1215,7 +1023,7 @@
|
|
||||||
iq_pubsub(Host, ServerHost, From, IQType, SubEl, Lang, Access, Plugins) ->
|
|
||||||
case exmpp_xml:remove_cdata_from_list(SubEl#xmlel.children) of
|
|
||||||
[#xmlel{name = Name, attrs = Attrs, children = Els} | Rest] ->
|
|
||||||
- Node = string_to_node(exmpp_xml:get_attribute_from_list_as_list(attrs, 'node', false)),
|
|
||||||
+ Node = string_to_node(exmpp_xml:get_attribute_from_list_as_list(Attrs, 'node', false)),
|
|
||||||
case {IQType, Name} of
|
|
||||||
{set, 'create'} ->
|
|
||||||
Config = case Rest of
|
|
||||||
@@ -1290,7 +1098,8 @@
|
@@ -1290,7 +1098,8 @@
|
||||||
(_, Acc) ->
|
(_, Acc) ->
|
||||||
Acc
|
Acc
|
||||||
|
Loading…
Reference in New Issue
Block a user