fix(bot): add callback to update message count after proxying

also re-add -with-last-message flag :D
This commit is contained in:
spiral
2022-12-10 16:50:22 +00:00
parent 8e0454a13b
commit 24db9f28c2
9 changed files with 32 additions and 17 deletions

View File

@@ -6,7 +6,6 @@ namespace PluralKit.Core;
// TODO: is inheritance here correct?
public class ListedMember: PKMember
{
// public ulong? LastMessage { get; }
public Instant? LastSwitchTime { get; }
public AnnualDate? AnnualBirthday =>

View File

@@ -9,10 +9,6 @@ from systems
create view member_list as
select members.*,
-- Find last message ID
-- max(mid) does full table scan, order by/limit uses index (dunno why, but it works!)
-- (select mid from messages where messages.member = members.id order by mid desc nulls last limit 1) as last_message,
-- Find last switch timestamp
(
select max(switches.timestamp)