diff options
Diffstat (limited to 'src/mod_muc_log.erl')
| -rw-r--r-- | src/mod_muc_log.erl | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mod_muc_log.erl b/src/mod_muc_log.erl index 14aef01e9..65e604ba4 100644 --- a/src/mod_muc_log.erl +++ b/src/mod_muc_log.erl @@ -241,10 +241,8 @@ code_change(_OldVsn, State, _Extra) -> {ok, State}. %%% Internal functions %%-------------------------------------------------------------------- add_to_log2(text, {Nick, Packet}, Room, Opts, State) -> - case {xml:get_subtag(Packet, <<"no-store">>), - xml:get_subtag(Packet, <<"no-permanent-store">>)} - of - {false, false} -> + case has_no_permanent_store_hint(Packet) of + false -> case {xml:get_subtag(Packet, <<"subject">>), xml:get_subtag(Packet, <<"body">>)} of @@ -256,7 +254,7 @@ add_to_log2(text, {Nick, Packet}, Room, Opts, State) -> Message = {subject, xml:get_tag_cdata(SubEl)}, add_message_to_log(Nick, Message, Room, Opts, State) end; - {_, _} -> ok + true -> ok end; add_to_log2(roomconfig_change, _Occupants, Room, Opts, State) -> @@ -1255,6 +1253,16 @@ calc_hour_offset(TimeHere) -> fjoin(FileList) -> list_to_binary(filename:join([binary_to_list(File) || File <- FileList])). +has_no_permanent_store_hint(Packet) -> + xml:get_subtag_with_xmlns(Packet, <<"no-store">>, ?NS_HINTS) + =/= false orelse + xml:get_subtag_with_xmlns(Packet, <<"no-storage">>, ?NS_HINTS) + =/= false orelse + xml:get_subtag_with_xmlns(Packet, <<"no-permanent-store">>, ?NS_HINTS) + =/= false orelse + xml:get_subtag_with_xmlns(Packet, <<"no-permanent-storage">>, ?NS_HINTS) + =/= false. + mod_opt_type(access_log) -> fun (A) when is_atom(A) -> A end; mod_opt_type(cssfile) -> fun iolist_to_binary/1; |
