25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Comment -spec lines to compile with ancient Erlang/OTP versions.

SVN Revision: 2517
This commit is contained in:
Badlop 2009-08-21 10:24:21 +00:00
parent c8e7a4f4ac
commit dabea295aa

View File

@ -30,7 +30,9 @@
update_subscription/1]).
-spec read_subscription(SubID :: string()) -> {ok, #pubsub_subscription{}} | notfound.
%% TODO: Those -spec lines produce errors in old Erlang versions.
%% They can be enabled again in ejabberd 3.0 because it uses R12B or higher.
%% -spec read_subscription(SubID :: string()) -> {ok, #pubsub_subscription{}} | notfound.
read_subscription(SubID) ->
case ejabberd_odbc:sql_query_t(
["select opt_name, opt_value "
@ -47,19 +49,19 @@ read_subscription(SubID) ->
-spec delete_subscription(SubID :: string()) -> ok.
%% -spec delete_subscription(SubID :: string()) -> ok.
delete_subscription(SubID) ->
ejabberd_odbc:sql_query_t(["delete from pubsub_subscription_opt "
"where subid = '", ejabberd_odbc:escape(SubID), "'"]),
ok.
-spec update_subscription(#pubsub_subscription{}) -> ok .
%% -spec update_subscription(#pubsub_subscription{}) -> ok .
update_subscription(#pubsub_subscription{subid = SubId} = Sub) ->
delete_subscription(SubId),
add_subscription(Sub).
-spec add_subscription(#pubsub_subscription{}) -> ok.
%% -spec add_subscription(#pubsub_subscription{}) -> ok.
add_subscription(#pubsub_subscription{subid = SubId, options = Opts}) ->
EscapedSubId = ejabberd_odbc:escape(SubId),
lists:foreach(fun(Opt) ->