]> granicus.if.org Git - ejabberd/commitdiff
mod_mam: Fix "assume_mam_usage: if_enabled"
authorHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 14 Jun 2016 14:40:46 +0000 (16:40 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 14 Jun 2016 14:40:46 +0000 (16:40 +0200)
src/mod_mam.erl

index 12b80c45c7ef15d8909ff0b4ae6f4c4b6885e7c8..fb42224db6d701ee7dcd8c408114f7b55dfe9522 100644 (file)
@@ -316,7 +316,12 @@ message_is_archived(false, C2SState, Peer,
                                         (never) -> never
                                      end, never) of
              if_enabled ->
-                 get_prefs(LUser, LServer);
+                 case get_prefs(LUser, LServer) of
+                     #archive_prefs{} = P ->
+                         {ok, P};
+                     error ->
+                         error
+                 end;
              on_request ->
                  Mod = gen_mod:db_mod(LServer, ?MODULE),
                  cache_tab:lookup(archive_prefs, {LUser, LServer},