mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-12 21:52:07 +02:00
mod_mam: Check whether MUC message is desired
This commit is contained in:
parent
85f4f90b45
commit
89f63a4fdf
|
@ -579,9 +579,30 @@ should_archive_peer(C2SState,
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
should_archive_muc(_MUCState, _Peer) ->
|
should_archive_muc(Pkt) ->
|
||||||
%% TODO
|
case xml:get_attr_s(<<"type">>, Pkt#xmlel.attrs) of
|
||||||
true.
|
<<"groupchat">> ->
|
||||||
|
case check_store_hint(Pkt) of
|
||||||
|
store ->
|
||||||
|
true;
|
||||||
|
no_store ->
|
||||||
|
false;
|
||||||
|
none ->
|
||||||
|
case xml:get_subtag_cdata(Pkt, <<"body">>) of
|
||||||
|
<<>> ->
|
||||||
|
case xml:get_subtag_cdata(Pkt, <<"subject">>) of
|
||||||
|
<<>> ->
|
||||||
|
false;
|
||||||
|
_ ->
|
||||||
|
true
|
||||||
|
end;
|
||||||
|
_ ->
|
||||||
|
true
|
||||||
|
end
|
||||||
|
end;
|
||||||
|
_ ->
|
||||||
|
false
|
||||||
|
end.
|
||||||
|
|
||||||
check_store_hint(Pkt) ->
|
check_store_hint(Pkt) ->
|
||||||
case has_store_hint(Pkt) of
|
case has_store_hint(Pkt) of
|
||||||
|
@ -635,7 +656,7 @@ store_msg(C2SState, Pkt, LUser, LServer, Peer, Dir) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
store_muc(MUCState, Pkt, RoomJID, Peer, Nick) ->
|
store_muc(MUCState, Pkt, RoomJID, Peer, Nick) ->
|
||||||
case should_archive_muc(MUCState, Peer) of
|
case should_archive_muc(Pkt) of
|
||||||
true ->
|
true ->
|
||||||
LServer = MUCState#state.server_host,
|
LServer = MUCState#state.server_host,
|
||||||
{U, S, _} = jid:tolower(RoomJID),
|
{U, S, _} = jid:tolower(RoomJID),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user