fix: DM close visibility flag, wire Remove Friend button, harden deploy script

- Redesign DM close as a visibility flag (closed column) instead of row deletion,
  so message broadcasts still reach users who closed a DM conversation
- Add broadcastDmMessage() helper that auto-resurfaces closed DMs when new messages arrive
- Wire Remove Friend button in DM welcome header with onClick handler and friend check
- Fix deploy.sh to cd to its own directory so rsync always runs from project root
This commit is contained in:
Jannis Braun
2026-02-22 22:29:40 +01:00
parent 6b8fd44a3a
commit 5fe43bc0c8
7 changed files with 112 additions and 108 deletions
+6
View File
@@ -35,6 +35,12 @@ export function runMigrations(db: Database.Database): void {
columns: [
{ name: 'dm_message_id', type: 'TEXT' }
]
},
{
name: 'dm_members',
columns: [
{ name: 'closed', type: 'INTEGER DEFAULT 0' }
]
}
];
+1
View File
@@ -74,6 +74,7 @@ export const dmChannels = sqliteTable('dm_channels', {
export const dmMembers = sqliteTable('dm_members', {
dmChannelId: text('dm_channel_id').notNull().references(() => dmChannels.id, { onDelete: 'cascade' }),
userId: text('user_id').notNull().references(() => users.id, { onDelete: 'cascade' }),
closed: integer('closed').default(0),
}, (table) => ({
pk: primaryKey({ columns: [table.dmChannelId, table.userId] }),
}));