diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 98144665c..0d7a864d7 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -352,7 +352,7 @@ receiver(Socket, C2SPid, XMLStreamPid) -> {ok, Text} -> xml_stream:send_text(XMLStreamPid, Text), receiver(Socket, C2SPid, XMLStreamPid); - {error, closed} -> + {error, Reason} -> exit(XMLStreamPid, closed), gen_fsm:send_event(C2SPid, closed), ok @@ -610,7 +610,9 @@ roster_change(IJID, ISubscription, StateData) -> StateData; P -> ?DEBUG("roster changed for ~p~n", [StateData#state.user]), - From = {StateData#state.user, StateData#state.server, ""}, + From = {StateData#state.user, + StateData#state.server, + StateData#state.resource}, Cond1 = (not StateData#state.pres_invis) and ((ISubscription == both) or (ISubscription == from)), Cond2 = ((ISubscription == none) or (ISubscription == to)) diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index 02b66dc62..6b47bc56b 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -346,7 +346,7 @@ receiver(Socket, C2SPid, XMLStreamPid) -> {ok, Text} -> xml_stream:send_text(XMLStreamPid, Text), receiver(Socket, C2SPid, XMLStreamPid); - {error, closed} -> + {error, Reason} -> exit(XMLStreamPid, closed), gen_fsm:send_event(C2SPid, closed), ok diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index 0ab41cc1f..7e889edc0 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -357,7 +357,7 @@ receiver(Socket, C2SPid, XMLStreamPid) -> {ok, Text} -> xml_stream:send_text(XMLStreamPid, Text), receiver(Socket, C2SPid, XMLStreamPid); - {error, closed} -> + {error, Reason} -> exit(XMLStreamPid, closed), gen_fsm:send_event(C2SPid, closed), ok diff --git a/src/ejabberd_service.erl b/src/ejabberd_service.erl index b3de12faa..ff3b4e546 100644 --- a/src/ejabberd_service.erl +++ b/src/ejabberd_service.erl @@ -261,7 +261,7 @@ receiver(Socket, C2SPid, XMLStreamPid) -> {ok, Text} -> xml_stream:send_text(XMLStreamPid, Text), receiver(Socket, C2SPid, XMLStreamPid); - {error, closed} -> + {error, Reason} -> exit(XMLStreamPid, closed), gen_fsm:send_event(C2SPid, closed), ok diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index be88e9ccd..b1312e3bc 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -359,7 +359,7 @@ record_to_item(R) -> search(Data) -> MatchSpec = make_matchspec(Data), F = fun() -> - mnesia:match_object(MatchSpec) + mnesia:select(vcard_search, [{MatchSpec, [], ['$_']}]) end, case mnesia:transaction(F) of {atomic, Rs} -> @@ -370,19 +370,7 @@ search(Data) -> make_matchspec(Data) -> - GlobMatch = #vcard_search{user = '_', - fn = '_', - family = '_', - given = '_', - middle = '_', - nickname = '_', - bday = '_', - ctry = '_', - locality = '_', - email = '_', - orgname = '_', - orgunit = '_' - }, + GlobMatch = #vcard_search{_ = '_'}, Match = filter_fields(Data, GlobMatch), Match.