26
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

Merge pull request #1165 from weiss/default-blocking-list

mod_blocking_sql: Handle default list corner case
This commit is contained in:
Evgeny Khramtsov 2016-06-23 10:44:47 +04:00 committed by GitHub
commit e54400a8e4

View File

@ -25,7 +25,12 @@ process_blocklist_block(LUser, LServer, Filter) ->
Default = case mod_privacy_sql:sql_get_default_privacy_list_t(LUser) of
{selected, []} ->
Name = <<"Blocked contacts">>,
mod_privacy_sql:sql_add_privacy_list(LUser, Name),
case mod_privacy_sql:sql_get_privacy_list_id_t(LUser, Name) of
{selected, []} ->
mod_privacy_sql:sql_add_privacy_list(LUser, Name);
{selected, [{_ID}]} ->
ok
end,
mod_privacy_sql:sql_set_default_privacy_list(LUser, Name),
Name;
{selected, [{Name}]} -> Name