mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 23:07:54 +00:00
Add member is public reminder message on member creation (if system has private members)
This commit is contained in:
parent
9282d5e9fb
commit
a5f7bacb3e
3 changed files with 15 additions and 0 deletions
|
|
@ -86,6 +86,15 @@ as $$
|
|||
where accounts.uid = account_id
|
||||
$$ language sql stable rows 10;
|
||||
|
||||
create function has_private_members(system_hid int) returns bool as $$
|
||||
declare m int;
|
||||
begin
|
||||
m := count(id) from members where system = system_hid and member_visibility = 2;
|
||||
if m > 0 then return true;
|
||||
else return false;
|
||||
end if;
|
||||
end
|
||||
$$ language plpgsql;
|
||||
|
||||
create function generate_hid() returns char(5) as $$
|
||||
select string_agg(substr('abcdefghijklmnopqrstuvwxyz', ceil(random() * 26)::integer, 1), '') from generate_series(1, 5)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ drop view if exists group_list;
|
|||
|
||||
drop function if exists message_context;
|
||||
drop function if exists proxy_members;
|
||||
drop function if exists has_private_members;
|
||||
drop function if exists generate_hid;
|
||||
drop function if exists find_free_system_hid;
|
||||
drop function if exists find_free_member_hid;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue