mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
mod_mam_mnesia: Fix check for empty archive
Don't return 'true' if the key exists but points to an empty archive. Also, avoid looking up all keys.
This commit is contained in:
parent
1684436bfe
commit
9a3a7369cb
@ -200,8 +200,7 @@ select(_LServer, JidRequestor,
|
||||
Result.
|
||||
|
||||
is_empty_for_user(LUser, LServer) ->
|
||||
not lists:member({LUser, LServer},
|
||||
mnesia:dirty_all_keys(archive_msg)).
|
||||
mnesia:dirty_read(archive_msg, {LUser, LServer}) == [].
|
||||
|
||||
is_empty_for_room(_LServer, LName, LHost) ->
|
||||
is_empty_for_user(LName, LHost).
|
||||
|
Loading…
Reference in New Issue
Block a user