25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

* src/mod_roster.erl: Show hyperlinks to local contacts when

browsing roster of account in Web Admin (EJAB-480)
* src/mod_roster_odbc.erl: Likewise

SVN Revision: 1778
This commit is contained in:
Badlop 2009-01-07 01:38:45 +00:00
parent 9f80ec4fb6
commit 14bc7cf77f
3 changed files with 44 additions and 4 deletions

View File

@ -1,5 +1,9 @@
2009-01-07 Badlop <badlop@process-one.net>
* src/mod_roster.erl: Show hyperlinks to local contacts when
browsing roster of account in Web Admin (EJAB-480)
* src/mod_roster_odbc.erl: Likewise
* src/web/ejabberd_web_admin.erl: WebAdmin serves Guide and links
to related sections; the path to guide.html can be configured with
option doc_path (EJAB-837)

View File

@ -815,9 +815,9 @@ user_roster(User, Server, Query, Lang) ->
[?C(Group), ?BR]
end, R#roster.groups),
Pending = ask_to_pending(R#roster.ask),
TDJID = build_contact_jid_td(R#roster.jid),
?XE("tr",
[?XAC("td", [{"class", "valign"}],
jlib:jid_to_string(R#roster.jid)),
[TDJID,
?XAC("td", [{"class", "valign"}],
R#roster.name),
?XAC("td", [{"class", "valign"}],
@ -855,6 +855,24 @@ user_roster(User, Server, Query, Lang) ->
?INPUTT("submit", "addjid", "Add Jabber ID")
])].
build_contact_jid_td(RosterJID) ->
%% Convert {U, S, R} into {jid, U, S, R, U, S, R}:
ContactJID = jlib:make_jid(RosterJID),
JIDURI = case {ContactJID#jid.luser, ContactJID#jid.lserver} of
{"", _} -> "";
{CUser, CServer} ->
case lists:member(CServer, ?MYHOSTS) of
false -> "";
true -> "/admin/server/" ++ CServer ++ "/user/" ++ CUser ++ "/"
end
end,
case JIDURI of
[] ->
?XAC("td", [{"class", "valign"}], jlib:jid_to_string(RosterJID));
URI when is_list(URI) ->
?XAE("td", [{"class", "valign"}], [?AC(JIDURI, jlib:jid_to_string(RosterJID))])
end.
user_roster_parse_query(User, Server, Items, Query) ->
case lists:keysearch("addjid", 1, Query) of
{value, _} ->

View File

@ -915,9 +915,9 @@ user_roster(User, Server, Query, Lang) ->
[?C(Group), ?BR]
end, R#roster.groups),
Pending = ask_to_pending(R#roster.ask),
TDJID = build_contact_jid_td(R#roster.jid),
?XE("tr",
[?XAC("td", [{"class", "valign"}],
jlib:jid_to_string(R#roster.jid)),
[TDJID,
?XAC("td", [{"class", "valign"}],
R#roster.name),
?XAC("td", [{"class", "valign"}],
@ -955,6 +955,24 @@ user_roster(User, Server, Query, Lang) ->
?INPUTT("submit", "addjid", "Add Jabber ID")
])].
build_contact_jid_td(RosterJID) ->
%% Convert {U, S, R} into {jid, U, S, R, U, S, R}:
ContactJID = jlib:make_jid(RosterJID),
JIDURI = case {ContactJID#jid.luser, ContactJID#jid.lserver} of
{"", _} -> "";
{CUser, CServer} ->
case lists:member(CServer, ?MYHOSTS) of
false -> "";
true -> "/admin/server/" ++ CServer ++ "/user/" ++ CUser ++ "/"
end
end,
case JIDURI of
[] ->
?XAC("td", [{"class", "valign"}], jlib:jid_to_string(RosterJID));
URI when is_list(URI) ->
?XAE("td", [{"class", "valign"}], [?AC(JIDURI, jlib:jid_to_string(RosterJID))])
end.
user_roster_parse_query(User, Server, Items, Query) ->
case lists:keysearch("addjid", 1, Query) of
{value, _} ->