mirror of
https://github.com/processone/ejabberd
synced 2025-10-04 02:09:33 +02:00
Use new cache API in mod_caps
This commit is contained in:
parent
ca9d04ba6b
commit
a26f90a346
3 changed files with 83 additions and 58 deletions
|
@ -33,6 +33,7 @@
|
|||
|
||||
-include("mod_caps.hrl").
|
||||
-include("ejabberd_sql_pt.hrl").
|
||||
-include("logger.hrl").
|
||||
|
||||
%%%===================================================================
|
||||
%%% API
|
||||
|
@ -57,9 +58,16 @@ caps_read(LServer, {Node, SubNode}) ->
|
|||
end.
|
||||
|
||||
caps_write(LServer, NodePair, Features) ->
|
||||
ejabberd_sql:sql_transaction(
|
||||
LServer,
|
||||
sql_write_features_t(NodePair, Features)).
|
||||
case ejabberd_sql:sql_transaction(
|
||||
LServer,
|
||||
sql_write_features_t(NodePair, Features)) of
|
||||
{atomic, _} ->
|
||||
ok;
|
||||
{aborted, Reason} ->
|
||||
?ERROR_MSG("Failed to write to SQL 'caps_features' table: ~p",
|
||||
[Reason]),
|
||||
{error, db_failure}
|
||||
end.
|
||||
|
||||
export(_Server) ->
|
||||
[{caps_features,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue