Configuring features is not possible since 721ca125

This commit is contained in:
Badlop 2022-08-17 12:08:04 +02:00
parent 90d9ef3a5d
commit 6adfc2cec5
2 changed files with 16 additions and 15 deletions

View File

@ -147,7 +147,8 @@ Usage
The web-presence feature by default is switched off for every user. If
user wants to use it, he should register on service `webpresence.example.org`,
which is accessible from Service Discovery.
There are several switches for web-presence:
There are several switches for web-presence,
but right now are all enabled and can't be disabled at all:
* Jabber ID: publish the presence in URIs that use the user's Jabber ID.
* Random ID: publish the presence in URIs that use a Random ID.
* XML: allow XML output.

View File

@ -467,16 +467,16 @@ send_message_registered(WP, To, Host, BaseURL, Lang) ->
{User, Server} = WP#webpresence.us,
JIDS = jid:encode({User, Server, <<"">>}),
Oavatar = case WP#webpresence.avatar of
false -> <<"">>;
%%false -> <<"">>;
true -> <<" avatar\n"
" avatar/my.png\n">>
end,
Ojs = case WP#webpresence.js of
false -> <<"">>;
%%false -> <<"">>;
true -> <<" js\n">>
end,
Otext = case WP#webpresence.text of
false -> <<"">>;
%%false -> <<"">>;
true -> ?BC([
<<" text\n"
" text/res/<">>, translate:translate(Lang, ?T("Resource")), <<">\n">>
@ -495,7 +495,7 @@ send_message_registered(WP, To, Host, BaseURL, Lang) ->
])
end,
Oxml = case WP#webpresence.xml of
false -> <<"">>;
%%false -> <<"">>;
true -> <<" xml\n">>
end,
Allowed_type = case {Oimage, Oxml, Oavatar, Otext, Ojs} of
@ -506,21 +506,21 @@ send_message_registered(WP, To, Host, BaseURL, Lang) ->
{_, _, _, _, _} -> <<"image">>
end,
{USERID_jid, Example_jid} = case WP#webpresence.jidurl of
false -> {<<"">>, <<"">>};
%%false -> {<<"">>, <<"">>};
true ->
JIDT = ?BC([<<"jid/">>, User, <<"/">>, Server]),
{?BC([<<" ">>, JIDT, <<"\n">>]),
?BC([<<" ">>, BaseURL, JIDT, <<"/">>, Allowed_type, <<"/\n">>])}
end,
{USERID_rid, Example_rid, Text_rid} = case WP#webpresence.ridurl of
false -> {<<"">>, <<"">>, <<"">>};
RID when is_binary(RID) ->
RIDT = ?BC([<<"rid/">>, RID]),
{?BC([<<" ">>, RIDT, <<"\n">>]),
?BC([<<" ">>, BaseURL, RIDT, <<"/">>, Allowed_type, <<"/\n">>]),
?BC([translate:translate(Lang, ?T("If you forget your RandomID, register again to receive this message.")), <<"\n">>,
translate:translate(Lang, ?T("To get a new RandomID, disable the option and register again.")), <<"\n">>])
}
false -> {<<"">>, <<"">>, <<"">>}%;
%%RID when is_binary(RID) ->
%% RIDT = ?BC([<<"rid/">>, RID]),
%% {?BC([<<" ">>, RIDT, <<"\n">>]),
%% ?BC([<<" ">>, BaseURL, RIDT, <<"/">>, Allowed_type, <<"/\n">>]),
%% ?BC([translate:translate(Lang, ?T("If you forget your RandomID, register again to receive this message.")), <<"\n">>,
%% translate:translate(Lang, ?T("To get a new RandomID, disable the option and register again.")), <<"\n">>])
%% }
end,
Subject = ?BC([translate:translate(Lang, ?T("Web Presence")), <<": ">>, translate:translate(Lang, ?T("registered"))]),
Body = ?BC([translate:translate(Lang, ?T("You have registered:")), <<" ">>, JIDS, <<"\n\n">>,
@ -572,7 +572,7 @@ try_auto_webpresence(LUser, LServer) ->
#webpresence{};
allow ->
#webpresence{us = {LUser, LServer},
ridurl = false,
ridurl = true,
jidurl = true,
xml = true,
avatar = true,