From 134dec5dbb6de3e6d97a937266f37a30a5bfd343 Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Fri, 8 Oct 2004 20:40:29 +0000 Subject: [PATCH] * src/mod_muc/mod_muc_room.erl: Fixed room destroying * src/ejabberd.cfg.example: Updated * src/ejabberd_sm.erl: Fixed message routing when all resources have negative priority * src/msgs/*.msg: Updated (thanks to Sergei Golovan) * src/web/ejabberd_web_admin.erl: Table titles now bold (thanks to Sergei Golovan) SVN Revision: 275 --- ChangeLog | 14 ++++++++++++++ doc/guide.tex | 2 +- src/ejabberd.cfg.example | 6 +++++- src/ejabberd_sm.erl | 25 +++++++++++++------------ src/mod_muc/mod_muc_room.erl | 6 ++++++ src/msgs/es.msg | 21 ++++++++++++++++++++- src/msgs/fr.msg | 21 ++++++++++++++++++++- src/msgs/nl.msg | 21 ++++++++++++++++++++- src/msgs/ru.msg | 21 ++++++++++++++++++++- src/msgs/ua.msg | 21 ++++++++++++++++++++- src/web/ejabberd_web_admin.erl | 15 +++++++++++---- 11 files changed, 150 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3005a91a2..3be518152 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2004-10-08 Alexey Shchepin + + * src/mod_muc/mod_muc_room.erl: Fixed room destroying + + * src/ejabberd.cfg.example: Updated + + * src/ejabberd_sm.erl: Fixed message routing when all resources + have negative priority + + * src/msgs/*.msg: Updated (thanks to Sergei Golovan) + + * src/web/ejabberd_web_admin.erl: Table titles now bold (thanks to + Sergei Golovan) + 2004-10-06 Alexey Shchepin * doc/guide.tex: Updated diff --git a/doc/guide.tex b/doc/guide.tex index dd2775f41..9021e6d40 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -77,7 +77,7 @@ then prefix \jid{#1.} is added to main \ejabberd{} hostname.} \author{Alexey Shchepin \\ \ahrefurl{mailto:alexey@sevcom.net} \\ \ahrefurl{xmpp:aleksey@jabber.ru}} -\date{June 24, 2004} +\date{October 8, 2004} \begin{document} \begin{titlepage} diff --git a/src/ejabberd.cfg.example b/src/ejabberd.cfg.example index 253752f53..3940f43f1 100644 --- a/src/ejabberd.cfg.example +++ b/src/ejabberd.cfg.example @@ -75,12 +75,16 @@ % this line: {auth_method, internal}. -% For LDAP uthentification use these lines instead of above one: +% For LDAP authentification use these lines instead of above one: %{auth_method, ldap}. %{ldap_servers, ["localhost"]}. % List of LDAP servers %{ldap_uidattr, "uid"}. % LDAP attribute that holds user ID %{ldap_base, "dc=example,dc=com"}. % Base of LDAP directory +% For authentification via external script use the following: +%{auth_method, external}. +%{extauth_program, "/path/to/authentification/script"}. + % Host name: {host, "localhost"}. diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 90bec9b67..bb8fb4951 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -260,7 +260,19 @@ do_route(From, To, Packet) -> route_message(From, To, Packet) -> LUser = To#jid.luser, case catch lists:max(get_user_present_resources(LUser)) of - {'EXIT', _} -> + {Priority, R} when is_integer(Priority), + Priority >= 0 -> + LResource = jlib:resourceprep(R), + LUR = {LUser, LResource}, + case mnesia:dirty_read({session, LUR}) of + [] -> + ok; % Race condition + [Sess] -> + Pid = Sess#session.pid, + ?DEBUG("sending to process ~p~n", [Pid]), + Pid ! {route, From, To, Packet} + end; + _ -> case xml:get_tag_attr_s("type", Packet) of "error" -> ok; @@ -274,17 +286,6 @@ route_message(From, To, Packet) -> Packet, ?ERR_SERVICE_UNAVAILABLE), ejabberd_router:route(To, From, Err) end - end; - {_, R} -> - LResource = jlib:resourceprep(R), - LUR = {LUser, LResource}, - case mnesia:dirty_read({session, LUR}) of - [] -> - ok; % Race condition - [Sess] -> - Pid = Sess#session.pid, - ?DEBUG("sending to process ~p~n", [Pid]), - Pid ! {route, From, To, Packet} end end. diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl index 17aaeacaa..810f1d580 100644 --- a/src/mod_muc/mod_muc_room.erl +++ b/src/mod_muc/mod_muc_room.erl @@ -2126,6 +2126,12 @@ destroy_room(DEls, StateData) -> Info#user.jid, Packet) end, ?DICT:to_list(StateData#state.users)), + case (StateData#state.config)#config.persistent of + true -> + mod_muc:forget_room(StateData#state.room); + false -> + ok + end, {result, [], stop}. diff --git a/src/msgs/es.msg b/src/msgs/es.msg index 7c04dec6d..04da7af2e 100644 --- a/src/msgs/es.msg +++ b/src/msgs/es.msg @@ -220,7 +220,26 @@ {"Options", "Opciones"}. {"Update", "Actualizar"}. {"Delete", "Eliminar"}. -{"", ""}. +{"Add User", ""}. +{"ejabberd (c) 2002-2004 Alexey Shchepin, 2004 Process One", ""}. +{"Offline messages", ""}. +{"Last Activity", ""}. +{"Never", ""}. +{"~s offline messages queue", ""}. +{"Time", ""}. +{"From", ""}. +{"To", ""}. +{"Packet", ""}. +{"Offline messages:", ""}. +{"Roster", ""}. +{"Nickname", ""}. +{"Subscription", ""}. +{"Pending", ""}. +{"Groups", ""}. +{"Remove", ""}. +{"Add JID", ""}. +{"User ", ""}. +{"Roster of ", ""}. % Local Variables: % mode: erlang diff --git a/src/msgs/fr.msg b/src/msgs/fr.msg index 5d7509394..7d667fac0 100644 --- a/src/msgs/fr.msg +++ b/src/msgs/fr.msg @@ -226,7 +226,26 @@ {"Options", ""}. {"Update", ""}. {"Delete", ""}. -{"", ""}. +{"Add User", ""}. +{"ejabberd (c) 2002-2004 Alexey Shchepin, 2004 Process One", ""}. +{"Offline messages", ""}. +{"Last Activity", ""}. +{"Never", ""}. +{"~s offline messages queue", ""}. +{"Time", ""}. +{"From", ""}. +{"To", ""}. +{"Packet", ""}. +{"Offline messages:", ""}. +{"Roster", ""}. +{"Nickname", ""}. +{"Subscription", ""}. +{"Pending", ""}. +{"Groups", ""}. +{"Remove", ""}. +{"Add JID", ""}. +{"User ", ""}. +{"Roster of ", ""}. % Local Variables: % mode: erlang diff --git a/src/msgs/nl.msg b/src/msgs/nl.msg index 242f140ac..dd4365fb2 100644 --- a/src/msgs/nl.msg +++ b/src/msgs/nl.msg @@ -248,7 +248,26 @@ {"Options", "Opties"}. {"Update", "Bijwerken"}. {"Delete", "Verwijderen"}. -{"", ""}. +{"Add User", ""}. +{"ejabberd (c) 2002-2004 Alexey Shchepin, 2004 Process One", ""}. +{"Offline messages", ""}. +{"Last Activity", ""}. +{"Never", ""}. +{"~s offline messages queue", ""}. +{"Time", ""}. +{"From", ""}. +{"To", ""}. +{"Packet", ""}. +{"Offline messages:", ""}. +{"Roster", ""}. +{"Nickname", ""}. +{"Subscription", ""}. +{"Pending", ""}. +{"Groups", ""}. +{"Remove", ""}. +{"Add JID", ""}. +{"User ", ""}. +{"Roster of ", ""}. % Local Variables: % mode: erlang diff --git a/src/msgs/ru.msg b/src/msgs/ru.msg index 6092b44af..142e66c17 100644 --- a/src/msgs/ru.msg +++ b/src/msgs/ru.msg @@ -248,7 +248,26 @@ {"Options", "Параметры"}. {"Update", "Обновить"}. {"Delete", "Удалить"}. -{"", ""}. +{"Add User", "Добавить пользователя"}. +{"ejabberd (c) 2002-2004 Alexey Shchepin, 2004 Process One", "ejabberd (c) 2002-2004 Алексей Щепин, 2004 Process One"}. +{"Offline messages", "Офлайновые сообщения"}. +{"Last Activity", "Последнее подключение"}. +{"Never", "Никогда"}. +{"~s offline messages queue", "Oчередь офлайновых сообщений ~s"}. +{"Time", "Время"}. +{"From", "От кого"}. +{"To", "Кому"}. +{"Packet", "Пакет"}. +{"Offline messages:", "Офлайновые сообщения:"}. +{"Roster", "Ростер"}. +{"Nickname", "Псевдоним"}. +{"Subscription", "Подписка"}. +{"Pending", "Ожидание"}. +{"Groups", "Группы"}. +{"Remove", "Удалить"}. +{"Add JID", "Добавить JID"}. +{"User ", "Пользователь "}. +{"Roster of ", "Ростер пользователя "}. % Local Variables: % mode: erlang diff --git a/src/msgs/ua.msg b/src/msgs/ua.msg index f4db92cca..d6b4c8601 100644 --- a/src/msgs/ua.msg +++ b/src/msgs/ua.msg @@ -248,7 +248,26 @@ {"Options", "Параметри"}. {"Update", "Обновити"}. {"Delete", "Видалити"}. -{"", ""}. +{"Add User", ""}. +{"ejabberd (c) 2002-2004 Alexey Shchepin, 2004 Process One", ""}. +{"Offline messages", ""}. +{"Last Activity", ""}. +{"Never", ""}. +{"~s offline messages queue", ""}. +{"Time", ""}. +{"From", ""}. +{"To", ""}. +{"Packet", ""}. +{"Offline messages:", ""}. +{"Roster", ""}. +{"Nickname", ""}. +{"Subscription", ""}. +{"Pending", ""}. +{"Groups", ""}. +{"Remove", ""}. +{"Add JID", ""}. +{"User ", ""}. +{"Roster of ", ""}. % Local Variables: % mode: erlang diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index 484ac8bcd..31ff45bb0 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -324,6 +324,13 @@ select { padding: 0.1em; } +thead { + color: #000000; + background-color: #ffffff; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10pt; + font-weight: bold; +} tr.head { color: #ffffff; @@ -1226,7 +1233,7 @@ user_info(User, Query, Lang) -> QueueLen = length(mnesia:dirty_read({offline_msg, User})), FQueueLen = [?AC("queue/", integer_to_list(QueueLen))], - [?XC("h1", "User: " ++ User)] ++ + [?XC("h1", ?T("User ") ++ User)] ++ case Res of ok -> [?CT("submitted"), ?P]; error -> [?CT("bad format"), ?P]; @@ -1291,7 +1298,7 @@ user_queue(User, Query, Lang) -> ?XAE("td", [{"class", "valign"}], [?XC("pre", FPacket)])] ) end, Msgs), - [?XC("h1", User ++ " offline messages queue")] ++ + [?XC("h1", io_lib:format(?T("~s offline messages queue"), [User]))] ++ case Res of ok -> [?CT("submitted"), ?P]; error -> [?CT("bad format"), ?P]; @@ -1367,7 +1374,7 @@ user_roster(User, Query, Lang, Admin) -> [?XE("thead", [?XE("tr", [?XCT("td", "JID"), - ?XCT("td", "Name"), + ?XCT("td", "Nickname"), ?XCT("td", "Subscription"), ?XCT("td", "Pending"), ?XCT("td", "Groups") @@ -1408,7 +1415,7 @@ user_roster(User, Query, Lang, Admin) -> "Remove")])]) end, SItems))])] end, - [?XC("h1", "Roster of " ++ User)] ++ + [?XC("h1", ?T("Roster of ") ++ User)] ++ case Res of ok -> [?CT("submitted"), ?P]; error -> [?CT("bad format"), ?P];