mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-28 17:38:54 +01:00
mod_blocking_sql: Handle default list corner case
Handle the situation where a list of the name "Blocked contacts" was created by an XEP-0016 client, but no default list exists.
This commit is contained in:
parent
751be3cca6
commit
065f5272e6
@ -25,7 +25,12 @@ process_blocklist_block(LUser, LServer, Filter) ->
|
|||||||
Default = case mod_privacy_sql:sql_get_default_privacy_list_t(LUser) of
|
Default = case mod_privacy_sql:sql_get_default_privacy_list_t(LUser) of
|
||||||
{selected, []} ->
|
{selected, []} ->
|
||||||
Name = <<"Blocked contacts">>,
|
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),
|
mod_privacy_sql:sql_set_default_privacy_list(LUser, Name),
|
||||||
Name;
|
Name;
|
||||||
{selected, [{Name}]} -> Name
|
{selected, [{Name}]} -> Name
|
||||||
|
Loading…
Reference in New Issue
Block a user