* src/msgs/ru.msg: Updated (thanks to Sergei Golovan)

* src/mod_muc/mod_muc_room.erl: Now private conferences are
visible to admins and owners of this conference (thanks to Sergei
Golovan)

* src/mod_muc/mod_muc.erl: More xml:lang support (thanks to Sergei
Golovan)

* src/mod_vcard.erl: Better processing of EMAIL tag (thanks to
Sergei Golovan)

* src/ejabberd_s2s_out.erl: Added "catch" to "open_socket" (thanks
to Sergei Golovan)

SVN Revision: 211
This commit is contained in:
Alexey Shchepin 2004-03-08 20:20:15 +00:00
parent 36f90d6a2d
commit bc672b44ea
6 changed files with 49 additions and 10 deletions

View File

@ -1,3 +1,20 @@
2004-03-08 Alexey Shchepin <alexey@sevcom.net>
* src/msgs/ru.msg: Updated (thanks to Sergei Golovan)
* src/mod_muc/mod_muc_room.erl: Now private conferences are
visible to admins and owners of this conference (thanks to Sergei
Golovan)
* src/mod_muc/mod_muc.erl: More xml:lang support (thanks to Sergei
Golovan)
* src/mod_vcard.erl: Better processing of EMAIL tag (thanks to
Sergei Golovan)
* src/ejabberd_s2s_out.erl: Added "catch" to "open_socket" (thanks
to Sergei Golovan)
2004-03-07 Alexey Shchepin <alexey@sevcom.net>
* src/web/ejabberd_http_poll.erl: Completed

View File

@ -114,8 +114,8 @@ open_socket(init, StateData) ->
{ok, _Socket} = R -> R;
{error, Reason1} ->
?DEBUG("s2s_out: connect return ~p~n", [Reason1]),
gen_tcp:connect(Addr, Port,
[binary, {packet, 0}, inet6])
catch gen_tcp:connect(Addr, Port,
[binary, {packet, 0}, inet6])
end,
case Res of
{ok, Socket} ->
@ -130,6 +130,11 @@ open_socket(init, StateData) ->
?DEBUG("s2s_out: inet6 connect return ~p~n", [Reason]),
Error = ?ERR_REMOTE_SERVER_NOT_FOUND,
bounce_messages(Error),
{stop, normal, StateData};
{'EXIT', Reason} ->
?DEBUG("s2s_out: inet6 connect crashed ~p~n", [Reason]),
Error = ?ERR_REMOTE_SERVER_NOT_FOUND,
bounce_messages(Error),
{stop, normal, StateData}
end.

View File

@ -280,19 +280,19 @@ iq_disco_info() ->
{xmlelement, "feature", [{"var", ?NS_VCARD}], []}].
process_iq_disco_items(Host, From, To, IQ) ->
process_iq_disco_items(Host, From, To, #iq{lang = Lang} = IQ) ->
Res = IQ#iq{type = result,
sub_el = [{xmlelement, "query",
[{"xmlns", ?NS_DISCO_ITEMS}],
iq_disco_items(Host, From)}]},
iq_disco_items(Host, From, Lang)}]},
ejabberd_router:route(To,
From,
jlib:iq_to_xml(Res)).
iq_disco_items(Host, From) ->
iq_disco_items(Host, From, Lang) ->
lists:zf(fun(#muc_online_room{name = Name, pid = Pid}) ->
case catch gen_fsm:sync_send_all_state_event(
Pid, {get_disco_item, From}, 100) of
Pid, {get_disco_item, From, Lang}, 100) of
{item, Desc} ->
{true,
{xmlelement, "item",

View File

@ -583,7 +583,7 @@ handle_event(Event, StateName, StateData) ->
%% {stop, Reason, NewStateData} |
%% {stop, Reason, Reply, NewStateData}
%%----------------------------------------------------------------------
handle_sync_event({get_disco_item, JID}, From, StateName, StateData) ->
handle_sync_event({get_disco_item, JID, Lang}, From, StateName, StateData) ->
FAffiliation = get_affiliation(JID, StateData),
FRole = get_role(JID, StateData),
Tail =
@ -592,12 +592,21 @@ handle_sync_event({get_disco_item, JID}, From, StateName, StateData) ->
(FAffiliation == admin) orelse
(FAffiliation == owner) of
true ->
Desc = case (StateData#state.config)#config.public of
true ->
"";
_ ->
translate:translate(Lang, "private, ")
end,
Len = length(?DICT:to_list(StateData#state.users)),
" (" ++ integer_to_list(Len) ++ ")";
" (" ++ Desc ++ integer_to_list(Len) ++ ")";
_ ->
""
end,
Reply = case (StateData#state.config)#config.public of
Reply = case ((StateData#state.config)#config.public == true) orelse
(FRole /= none) orelse
(FAffiliation == admin) orelse
(FAffiliation == owner) of
true ->
{item, get_title(StateData) ++ Tail};
_ ->

View File

@ -147,9 +147,16 @@ set_vcard(User, VCARD) ->
BDay = xml:get_path_s(VCARD, [{elem, "BDAY"}, cdata]),
CTRY = xml:get_path_s(VCARD, [{elem, "ADR"}, {elem, "CTRY"}, cdata]),
Locality = xml:get_path_s(VCARD, [{elem, "ADR"}, {elem, "LOCALITY"},cdata]),
EMail = xml:get_path_s(VCARD, [{elem, "EMAIL"}, cdata]),
EMail1 = xml:get_path_s(VCARD, [{elem, "EMAIL"}, {elem, "USERID"},cdata]),
EMail2 = xml:get_path_s(VCARD, [{elem, "EMAIL"}, cdata]),
OrgName = xml:get_path_s(VCARD, [{elem, "ORG"}, {elem, "ORGNAME"}, cdata]),
OrgUnit = xml:get_path_s(VCARD, [{elem, "ORG"}, {elem, "ORGUNIT"}, cdata]),
EMail = case EMail1 of
"" ->
EMail2;
_ ->
EMail1
end,
LUser = jlib:nodeprep(User),
LFN = stringprep:tolower(FN),

View File

@ -167,6 +167,7 @@
{"Invalid affiliation: ~s", "Недопустимый ранг: ~s"}.
{"Invalid role: ~s", "Недопустимая роль: ~s"}.
{"Owner privileges required", "Требуются права владельца"}.
{"private, ", "приватная, "}.
% mod_irc/mod_irc.erl
{"ejabberd IRC module\nCopyright (c) 2003-2004 Alexey Shchepin",