1 |
|
-module(ejabberd_gen_mam_archive). |
2 |
|
|
3 |
|
-callback archive_size(Acc, Params, Extra) -> gen_hook:hook_fn_ret(Acc) when |
4 |
|
Acc :: integer(), |
5 |
|
Params :: #{archive_id := mod_mam:archive_id() | undefined, owner => jid:jid(), room => jid:jid()}, |
6 |
|
Extra :: gen_hook:extra(). |
7 |
|
|
8 |
|
-callback archive_message(Acc, Params, Extra) -> gen_hook:hook_fn_ret(Acc) when |
9 |
|
Acc :: ok | {error, term()}, |
10 |
|
Params :: mod_mam:archive_message_params(), |
11 |
|
Extra :: gen_hook:extra(). |
12 |
|
|
13 |
|
-callback lookup_messages(Acc, Params, Extra) -> gen_hook:hook_fn_ret(Acc) when |
14 |
|
Acc :: {ok, mod_mam:lookup_result()} | {error, term()}, |
15 |
|
Params :: mam_iq:lookup_params(), |
16 |
|
Extra :: gen_hook:extra(). |
17 |
|
|
18 |
|
-callback get_mam_pm_gdpr_data(Acc, Params, Extra) -> gen_hook:hook_fn_ret(Acc) when |
19 |
|
Acc :: mam_pm_gdpr_data(), |
20 |
|
Params :: #{jid := jid:jid()}, |
21 |
|
Extra :: gen_hook:extra(). |
22 |
|
|
23 |
|
-callback get_mam_muc_gdpr_data(Acc, Params, Extra) -> gen_hook:hook_fn_ret(Acc) when |
24 |
|
Acc :: mam_muc_gdpr_data(), |
25 |
|
Params :: #{jid := jid:jid()}, |
26 |
|
Extra :: gen_hook:extra(). |
27 |
|
|
28 |
|
-optional_callbacks([get_mam_pm_gdpr_data/3, |
29 |
|
get_mam_muc_gdpr_data/3, |
30 |
|
archive_size/3, |
31 |
|
lookup_messages/3]). |
32 |
|
|
33 |
|
-type mam_pm_gdpr_data() :: [{MessageID :: bitstring(), |
34 |
|
FromJID :: bitstring(), |
35 |
|
Message :: bitstring()}]. |
36 |
|
|
37 |
|
-type mam_muc_gdpr_data() :: [{MessageID :: bitstring(), |
38 |
|
Message :: bitstring()}]. |
39 |
|
|
40 |
|
-export_type([mam_pm_gdpr_data/0, mam_muc_gdpr_data/0]). |