Commit Graph
943 Commits
Author SHA1 Message Date
Evgeny Poberezkin 192c08d74d Merge branch 'master' into ep/p2p-group-signing 2026-09-02 19:21:07 +01:00
EvgenyandEvgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com> 735662902f core, ui: make badge expiration non-optional (#7445)
* core, ui: make badge expiration non-optional

* update

* update bot types

* fix to use non-optional badge expiry

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-09-02 08:14:09 +01:00
EvgenyandEvgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com> f99c474ca6 core: send badge ZK-proofs to XFTP servers, add file expiry time (#7430)
* core: send badge ZK-proofs to XFTP servers

* update simplexmq, use keys and header from simplexmq

* core: add file expiry time

* refactor

* remove posix module

* rename migrations

* bot api

* update UI

* import

* show item from loaded information

* ios: update core library

* text

* send entitlements in handshake

* simplexmq

* query plans

* update simplexmq

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-09-01 23:16:15 +01:00
EvgenyandEvgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com> f71b132536 core: support **text** as bold markdown (#7444)
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-09-01 12:27:53 +01:00
Evgeny c14770ce51 core: fix test for aborting connection switching (pin to previous version) (#7418) 2026-08-25 13:13:16 +01:00
EvgenyandEvgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com> 17cdef1692 core: include channel link and name when forwarding messages (#7409)
* core: include channel link and name when forwarding messages

* wip

* simplify

* add member ID

* refactor

* refactor

* refactor

* update api types

* store forward source group type

* rename

* api types

* simpler layout

* layout, translations

* refactor ios

* public

* simpler

* refactor kotlin

* padding

* padding

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-08-24 21:36:57 +01:00
Evgeny Poberezkin e1c61cff37 Merge branch 'master' into ep/p2p-group-signing 2026-08-19 08:21:35 +01:00
ecb008b792 core, ui: auto-accept group invitations per user profile (#7377)
* core, ui: auto-accept group invitations per user profile

Add a per-profile toggle for auto-accepting group invitations, and regroup it
with the existing contact-requests setting under a single Auto-accept section
in Privacy & Security, relabelled "Contact requests in groups".

The join is fully async. processGroupInvitation already had an async accept
path, used when the invitation matches a group link the user opened:
prepareAgentJoin + createMemberConnectionAsync + joinAgentConnectionAsync,
with the outcome reported later against the CFJoinConn command id. Auto-accept
takes that same path instead of going through APIJoinGroup, so it works while
the app is closed and never blocks message processing.

An auto-accepted invitation still records a CIRcvGroupInvitation item in the
chat with the inviting contact, so there is a record of who added the user to
which group.

Two details worth noting for review:

hostContact is reported to clients only for group links. Clients respond to it
by replacing the transient host connection view with the group and removing
that chat - correct for a group link, where the contact is a placeholder, but
wrong for a plain invitation, where it is a real contact.

A resent invitation returns the existing group, because createGroupInvitation
is idempotent on inv_queue_info. The join therefore only runs while the
membership is still GSMemInvited, so a resend cannot open a second connection.

* booldef

* order

* refactor

* update translation key

* query plans

* ios: export translations

---------

Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2026-08-19 00:10:54 +01:00
Narasimha-scandEvgeny Poberezkin 0bc35fd1eb directory: identify registration owner by member id to fix incorrect de-listing (#7362)
* directory: identify registration owner by member id to fix incorrect de-listing

The leave/removed/role-changed handlers identified the registration owner by
contact id. A non-owner member can be associated with the owner's contact (via
the contact/member merge), so its departure incorrectly de-listed the group.
Compare by group member id (owner_member_id) instead, falling back to contact
id for registrations recorded before owner_member_id existed.

* fix test, always compare contact ID in owner check

---------

Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
2026-08-18 22:58:56 +01:00
shandEvgeny Poberezkin cbfdf63f4b core: drop agent versions in simplexmq (#7360)
* core: adapt to dropped agent versions

* refactor

* remove comments

* api types, protocol tests

* fix test

---------

Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
2026-08-18 22:50:59 +01:00
Evgeny Poberezkin 1160215570 Merge stable 2026-08-18 17:16:21 +01:00
EvgenyandEvgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com> 5e45fe1f0e directory: only create group links after approval (#7356)
* directory: only create group links after approval

* update test

* update messages

* diff

* get group and link in one query

* reduce database reads

* better errors

* typos

* query plans

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-08-18 16:35:37 +01:00
spaced4ndy 493fb9cee8 core: limit the number of messages in a batch (#7364) 2026-08-13 10:04:21 +00:00
Evgeny Poberezkin 42c20c5015 Merge branch 'master' into ep/p2p-group-signing 2026-08-12 09:06:15 +01:00
spaced4ndy e04e080a3d core: prevent remote controller from writing files outside files folder (#7352) 2026-08-07 13:26:48 +00:00
Evgeny @ SimpleX Chat 7477cb4c82 add tests 2026-08-04 16:59:33 +00:00
Evgeny @ SimpleX Chat c899a39cf3 update test 2026-08-04 12:50:50 +00:00
Evgeny Poberezkin bf8290c90f remove test delays 2026-08-04 08:16:46 +01:00
Evgeny @ SimpleX Chat 01bb8d8e7a fix sending messages in groups with members before version 18 2026-08-04 07:12:51 +00:00
Evgeny @ SimpleX Chat 9b83ef7e73 failing test 2026-08-03 19:59:39 +00:00
Evgeny @ SimpleX Chat 45c11d8f8c Merge branch 'master' into ep/p2p-group-signing 2026-08-02 16:33:40 +00:00
Evgeny 34b74d1c49 directory: remove support for directory log file (#7331)
* directory: remove support for directory log file

* remove unused exports
2026-08-02 16:01:22 +01:00
Evgeny Poberezkin 2caf1655e1 fix test, query plans 2026-08-02 11:30:36 +01:00
Evgeny @ SimpleX Chat 91c74bdfcc disable test output 2026-08-01 22:00:19 +00:00
Evgeny @ SimpleX Chat bc53c723ab simplify 2026-08-01 21:50:16 +00:00
Evgeny @ SimpleX Chat 7f4a424d1b fix more tests 2026-08-01 21:46:15 +00:00
Evgeny Poberezkin 1938690b02 fix tests 2026-08-01 22:43:31 +01:00
Evgeny @ SimpleX Chat b5af1f388e increase timeout 2026-08-01 21:30:25 +00:00
Evgeny Poberezkin 39957589e0 Merge branch 'master' into ep/p2p-group-signing 2026-08-01 21:24:34 +01:00
Evgeny @ SimpleX Chat ba09a79c53 fix test 2026-08-01 20:03:44 +00:00
Evgeny @ SimpleX Chat c4675bf89f add key distribution steps, and fix some tests 2026-08-01 19:13:33 +00:00
EvgenyandEvgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com> e1a349b90f core: support contact addresses with DR keys, service requests (#7310)
* core: use double ratchet keys in contact address (#7278)

* core: use double ratchet keys in contact address

* use PQ from the first message

* query plans

* update simplexmq

* api to rotate keys, option to show full links in CLI

* shorter description

* ui: add error parameters

* disable DR in addresses

* core: parameter for create address command to configure ratchet keys

* add pqRatchet param to address-related commands

* query plan

* fix parser

* fix kotlin

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>

* core: contact request rejection and service requests (#7292)

* update simplexmq

* implement service requests and rejections

* tests

* migration

* fix migration

* add api event and response

* bot api, postgres migration

* nix shas

* bot types, rename property

* update bot type

* sign service requests

* update bots api

* query plan

* update plan

* update simplexmq

* fix test, update bot api

* fix bot api

* resolve name for service request

* refactor

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>

* update simplexmq

* update simplexmq

* test delays

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-08-01 12:51:03 +01:00
Evgeny @ SimpleX Chat 6c74a917a4 fix some tests 2026-07-31 21:30:32 +00:00
Evgeny Poberezkin 85f2e01aa5 fix test 2026-07-31 11:59:23 +01:00
Evgeny Poberezkin f99473ca6f Merge branch 'master' into ep/p2p-group-signing 2026-07-29 19:40:32 +01:00
EvgenyandEvgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com> f1418f9e55 core: drop support of chat versions older than 08/2024 (#7319)
* core: drop support of chat versions older than 08/2024

* fix encoding tests

* skip failing tests

* rename

* fix

* query plans

* remove unused legacy code

* remove more unused

* remove unused

* remove unused names

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-07-29 19:06:20 +01:00
Evgeny @ SimpleX Chat 065c805972 fix test 2026-07-27 12:45:33 +00:00
Narasimha-sc 3726040d84 core: ignore mentions and replies of blocked members (#7303)
Messages of blocked members are hidden, but they still marked chat item
as user mention, showing mention badge and counting group as unread in
"mentions only" notification mode:
- createNonLive passed mentions unfiltered, allowing members blocked by
  admin to mention user - it is the default path, as it is only used
  when full delete is not allowed;
- userReply was set for replies to user messages from blocked members.
2026-07-25 10:42:34 +01:00
Narasimha-sc dc3c106bda core: remove SimpleX Status preset contact (#7231)
* core: remove SimpleX Status preset contact

Preset contact cards are only created at user record creation
(createPresetContactCards), so this affects new profiles only;
existing profiles keep their stored SimpleX Status contact.

Removing the card shifts contact ids allocated after /create user
down by one, hence the test id updates.

* plans: justify SimpleX Status preset contact removal
2026-07-24 09:05:12 +01:00
Narasimha-sc 177a591466 core: fix member support chats staying marked unread after they're read (#7281)
* core: don't mark member support chat items read when reading group without scope

Reading a group without a scope marked support-scope items read without
decrementing the per-member support_chat_items_* counters, so members stayed
unread in the support list even after their chat was fully read. Restrict the
no-scope group read and its timed-items query to main-scope items.

* plans: support chat unread on no-scope group read

* core: update query plans for group scope read

The main-scope read and timed-items queries now filter on group_scope_tag
and group_scope_group_member_id, so they seek via idx_chat_items_group_scope_stats_all
(5-column) instead of idx_chat_items_groups_user_mention (3-column).

* plans: document query-plan and benchmark performance results

* tests: fix unreliable support item id capture in no-scope group read test

lastItemId returns the latest item by item_ts, which right after createGroup2
can be the group "connected" event rather than the just-sent support message.
The per-item read then targeted the wrong (already-read, main-scope) item and
never decremented the support counters, so the test failed regardless of the
fix (consistently in CI, flakily locally depending on item ordering).

Capture the support item id directly from the member-support scope instead,
keeping the change contained to this test. Verified: the test passes with the
fix and fails when the fix is reverted.

* tests: fix name-shadowing build error in no-scope group read test

The local pattern binding `itemId` shadowed the `itemId` helper imported
from ChatTests.Utils, which -Wname-shadowing (Werror) rejects. Rename the
local binding to `iId`.
2026-07-23 10:17:27 +01:00
sh afdae36ea3 tests: enable names role for directory channel name tests (#6643) 2026-07-21 09:25:49 +01:00
shandEvgeny Poberezkin 2ea5940e81 core, ui: per-server roles for self-hosted servers (#7254)
* core, ui: plan per-server roles for self-hosted servers

* core: add per-server roles field to UserServer

* core: add nullable role columns to protocol_servers

* core: persist per-server roles

* core: validate server coverage using per-server roles

* test: cover per-server roles resolution and coverage

* multiplatform: per-server role toggles for self-hosted servers

* ios: per-server role toggles for self-hosted servers

* core: per-server role overrides with per-role defaults

* test: cover three-state per-server role resolution

* fix: derive Eq for ServerRolesOverride

* multiplatform: three-state role dropdowns on saved servers

* ios: three-state role pickers on saved servers

* test: per-server roles independent across two servers

* test: enable names role in name-resolution tests

* style: trim comments in per-server roles code

* chore: rename server_roles migration to 20260716 (last)

* core: per-server roles override operator roles, inherit when unset

* multiplatform: per-server role default inherits from operator

* ios: per-server role default inherits from operator

* refactor(servers): tidy per-server roles per review

- dedup no-operator default into ServerRoles.noOperatorDefault (Kotlin/Swift)
- iOS: move roles-section control flow to the call site via a named gate,
  and parse the server address once instead of up to three times
- Kotlin: collapse redundant derivedState; revert defaultOn->default rename
  for cross-platform parity
- drop unused Hashable conformance on Swift ServerRoles
- add agentServerCfgs test for names inheritance from an operator
- remove no-op enableNamesRole calls from dormant DirectoryTests
- fix ChatClient import ordering

* chore(migration): date server_roles migration 20260720

* only show roles when server is enabled, move section above QR code

---------

Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
2026-07-20 16:35:13 +01:00
spaced4ndy 93831a0f24 core: signed history in channels, auto-sign based on preference (#7257) 2026-07-17 19:44:51 +00:00
Evgenysimplex-chat-agent[bot] <287173099+simplex-chat-agent[bot]@users.noreply.github.com>Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
6375457685 core: add optional profile description (#7256)
* core: add optional profile description

* bot types

* kotlin ui

* query plans

* postgres schema

* fix ui

* fix UI

* refactor

* description in business chats

* share address

* sign address card when shared by owner

* from owner string

* remove unused string

* refactor

* fix

* ProfileDescriptionText

* refactor modals

* ios ui

* nix config

* correction

Co-authored-by: simplex-chat-agent[bot] <287173099+simplex-chat-agent[bot]@users.noreply.github.com>

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
Co-authored-by: simplex-chat-agent[bot] <287173099+simplex-chat-agent[bot]@users.noreply.github.com>
2026-07-15 17:54:21 +01:00
spaced4ndy 0fef34914d core, ui: security code verification in channels (verify member key) (#7255) 2026-07-15 10:46:31 +00:00
sh 6e2995cab6 cli: add name, image and relay server address flags (#6944)
* cli: add --relay-address-server option for chat relay

New CLI flag --relay-address-server SERVER selects the SMP server used
for the chat relay address link created at startup. Only valid together
with --relay; errors out otherwise.

Threads Maybe SMPServerWithAuth through APICreateMyAddress to the new
agent createConnection parameter.

* cli: add --user-display-name option

Selects or creates the active user non-interactively:
- no active user: create one with the given display name
- active user with matching localDisplayName: continue
- active user with different name: exit with error

Mutually exclusive with --create-bot-display-name.

* cli: add --user-image-file option

Sets the active user's profile image from a .png/.jpg/.jpeg file at
startup. Reads file, base64-encodes as data URL, and updates the user
profile directly in the DB - no notification is sent to existing
contacts. Skips the update if the stored image already matches.

Requires --user-display-name.

* cli: address PR review comments

- rename APICreateMyAddress field srv_ to server_
- extract repeated `loop` and putStrLn from createActiveUser via
  prompt where-clause
- fuse u_ inspection: validate active user display name in the same
  case that creates the user when missing

* cli: enforce profile image size limit in --user-image-file

Reject the file if the encoded data URL exceeds 12500 bytes - matches
the cap mobile and desktop UIs pass to resizeImageToStrSize for profile
images. Without this, oversized images would be silently set on the
user profile.

* core: validate profile image size in chat commands

Enforced in CreateActiveUser, updateProfile_, newGroup, runUpdateGroupProfile
via checkProfileImageSize; max 12500 bytes (matches mobile UIs).

* fix: thread new ChatOpts/CoreChatOpts fields through bot/test constructors

* bots/docs: filter hidden params before type introspection

Hide APICreateMyAddress server_ field so the bot doc generator does not
try to introspect SMPServerWithAuth (an unregistered type).

* core: validate full encoded profile size

Add checkProfileSize / checkGroupProfileSize that encode the full
ChatMessage and check against maxEncodedInfoLength, so a long
displayName/bio combined with a near-max image is also caught at
command time instead of failing later at send time with CEException.

Run alongside the existing checkProfileImageSize (image-only cap of
12500 bytes, matching mobile UIs) in CreateActiveUser, updateProfile_,
newGroup, runUpdateGroupProfile. Update genProfileImg to fit the cap.

* cli: add --headless option for chat relay

Skips interactive prompts (relay address creation, display name) so the
chat relay can run non-interactively as a service. Requires --relay;
creating a new profile also requires --user-display-name.

* test: cover profile image size limit and address server

Adds tests for two new capabilities:
- profile image size validation rejects oversized images
- /_address with a server pins the address to the requested SMP server

* core: update simplexmq (pass optional SMP server to prepareConnectionLink)

* cli: add /set profile image file, fix image flag

Add "/set profile image file <path>" command to set the profile image
from a .png/.jpg/.jpeg file in a running session.

Make --user-image-file create-only: for an existing user it now no-ops
with a note instead of failing with "chat not started" (the update ran
before the chat controller was started).

* core: unify image loading and profile size checks

- loadImageFile (CLI) and readProfileImageFile (command) now share one
  loadImageData; removes the duplicated mime/base64 encoding and its
  decodeUtf8/safeDecodeUtf8 divergence. A missing --user-image-file no
  longer crashes with an uncaught IOException, and empty files are rejected.
- checkProfileSize/checkGroupProfileSize share checkInfoSize.
- --relay-address-server/--headless requires-relay checks use
  errorWithoutStackTrace, matching the adjacent validation (no callstack dump).

* bots/docs: document UpdateProfileImageFromFile as a CLI command
2026-07-15 09:31:19 +01:00
spaced4ndy 2b4a9c3d73 tests: create separate tmp folders for test clients (#7244) 2026-07-13 11:05:59 +00:00
EvgenyandEvgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com> c1cc568704 core, web: correctly process name verification for channels, show names in directory (#7238)
* core, web: correctly process name verification for channels, show names in directory

* remove duplicate verification

* remove plan

* refactor

* remove comments

* stabilize tests

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-07-12 18:52:45 +01:00
EvgenyandEvgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com> 414f4b6ce1 core, ui: show domain for business chat in CLI, test, improve UI (#7235)
* core: preserve domain during group handshake

* query plans

* ui changes

* remove unnecessary change

* improve ui

* name UI

* card layout

* fix footers, entry field

* error icon

* fix height

* fix layout

* fix layout

* remove unused string

* focus name field

* refactor, fix

* improve button

* refactor

* fix ios race

* core: add domain to channel /i output

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-07-12 09:41:05 +01:00
spaced4ndy 51ad366e8b core, ui: message signing (#7115) 2026-07-10 19:55:10 +00:00