diff options
author | Badlop <badlop@process-one.net> | 2009-08-21 10:24:21 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2009-08-21 10:24:21 +0000 |
commit | dabea295aa3eb16e74a9485e69f0d6f1d8a555e0 (patch) | |
tree | 30bc59978aff7cfb3d99b0a77c9ed6b0bbeb9079 /src | |
parent | Modify exmpp header lines to compile with ancient Erlang/OTP versions. (diff) |
Comment -spec lines to compile with ancient Erlang/OTP versions.
SVN Revision: 2517
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_pubsub/pubsub_db_odbc.erl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mod_pubsub/pubsub_db_odbc.erl b/src/mod_pubsub/pubsub_db_odbc.erl index e31ad2aca..3df26c171 100644 --- a/src/mod_pubsub/pubsub_db_odbc.erl +++ b/src/mod_pubsub/pubsub_db_odbc.erl @@ -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) -> |