core, ui: support chat item TTL per chat and group aliases (#5415)

* core: support chat item TTL per chat

* ios: UI mockup

* core: chat time to live and group local alias support (#5533)

* functions and type placeholders

* simplify

* queries to make tests pass

* set chat queries

* fetch queries

* get local aliases for groups

* local alias support for groups

* simplify

* fix tests

* fix

---------

Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>

* migration

* add test for expiration

* expireChatItems

* refactor queries, read objects inside the loop

* add groupId to query

* fix updateGroupAlias

* ios group alias

* ttl

* changes

* fixes and test

* new types for ttl

* chat and groups ttl in ios

* accurate alert

* label

* progress indicator, disable interactions while api running

* just call expire chat items

* android, desktop: add local alias to groups (#5544)

* android, desktop: add local alias to groups

* different placeholder for chats vs contacts

* improvements and fixes

* only expire chat items, not all items, when chat ttl changes

* refactor, fix conditions

* refactor

* refactor ChatTTLOption

* text

* fix

* make ttl state

* fix crash/remove warnings

* fix for current?

---------

Co-authored-by: Diogo <diogofncunha@gmail.com>
This commit is contained in:
Evgeny
2025-01-20 18:06:00 +00:00
committed by GitHub
parent 20fa30eacc
commit 7e864f9178
27 changed files with 869 additions and 326 deletions
@@ -82,6 +82,7 @@ CREATE TABLE contacts(
custom_data BYTEA,
ui_themes TEXT,
chat_deleted SMALLINT NOT NULL DEFAULT 0,
chat_item_ttl BIGINT,
FOREIGN KEY(user_id, local_display_name)
REFERENCES display_names(user_id, local_display_name)
ON DELETE CASCADE
@@ -140,6 +141,8 @@ CREATE TABLE groups(
business_chat TEXT NULL,
business_xcontact_id BYTEA NULL,
customer_member_id BYTEA NULL,
chat_item_ttl BIGINT,
local_alias TEXT DEFAULT '',
FOREIGN KEY(user_id, local_display_name)
REFERENCES display_names(user_id, local_display_name)
ON DELETE CASCADE