956 Commits

Author SHA1 Message Date
wappensc-developer
6302698701
Deliver the envelope in hand to the last receive handler before it is removed (#2153)
removeReceiveHandler removed the handler before it stopped the receive
thread. An envelope the thread was handling then was already cached and
acknowledged to the server; it reached no handler, and the cache dropped it
once handled, so it was lost. While removing the last handler stops the
thread, the handler stays in drainingHandlers: it still gets that envelope,
but doesn't keep the thread receiving.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 09:30:13 +02:00
AsamK
c2b9c25b7c Always use server signed group change for updating local group 2026-10-14 11:57:50 +02:00
wakamex
c3b0fe902e
Accept group invitations addressed to the PNI (#2146)
An invitation by phone number lists the account's PNI as the pending member. acceptInvite compared pending members only with the self ACI address and failed with 'Cannot find service ID for self to accept invite'. It now matches either the ACI or the PNI, makes the change as the ACI, and for a PNI promotion decrypts the server's signed change, since the locally built action has no member ciphertexts to decrypt.
2026-10-14 11:56:36 +02:00
AsamK
f7c1ae1034 Fix test 2026-10-10 08:52:48 +02:00
AsamK
32f652efc9 Update libsignal-service
Fixes #2140
2026-10-09 18:38:01 +02:00
Copilot
3aeaa34baa
Download attachments from synced message edits (#2143)
* Initial plan

* Handle attachments in synced edits

Co-authored-by: AsamK <2340865+AsamK@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AsamK <2340865+AsamK@users.noreply.github.com>
2026-10-09 17:00:13 +02:00
iddo
6f2ea80060
Fix race between stopping and starting the receive thread (#2142)
* Fix race between stopping and starting the receive thread

When the last receive handler was removed, receiveThread was cleared
before the thread had stopped. A handler added in that window, e.g. by
a client reconnecting to the daemon in on-connection receive mode,
started a second receive thread. While the stop request for the old
thread was still set, each new thread ended immediately and started the
next one. When the old thread ended, it cleared the reference to the
newer thread and started yet another one, leaving two receive loops on
the same websocket. The unreferenced loop was never stopped and kept
receiving and acknowledging messages after all clients had gone.

Keep receiveThread set until the receive thread has finished and only
let the thread itself clear it. Its end block already starts a new
receive thread if handlers were added in the meantime. Clear a stop
request right before a new receive loop is started instead of when a
loop ends, so it can neither be cleared by another loop nor stop a
later one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add test for adding a receive handler while the receive thread stops

The receive loop is replaced by a fake one that can be held while it
stops, so the test doesn't connect to the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: iddo <917594+iddo@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:28:42 +02:00
AsamK
8c86d30655 Update libsignal-service 2026-10-07 12:46:24 +02:00
Robert Nisipeanu
ebf24ee0b0
Use account device IDs for calls and verify primary and linked configurations (#2128)
* Fix voice calls from linked devices

(cherry picked from commit f3e22de14e4463adb785fb797791bc826b765a10)

* Verify primary and linked call configuration through account state

---------

Co-authored-by: Daniel <dan@gainengineering.com.au>
2026-10-06 20:10:53 +02:00
Dmytro Lomako
ca2583c1b0
Improve attachment upload failure handling (#2135) 2026-10-06 20:08:42 +02:00
AsamK
0dde3d8596 Reformat files 2026-10-06 17:50:56 +02:00
AsamK
da8c69b2a2 Fix listener leaked per json-rpc connection
Fixes #2136
Fixes #1653
2026-10-06 17:39:11 +02:00
AsamK
29dcac23cf Improve attachment download failure handling
Fixes #2116
2026-09-22 21:04:34 +02:00
AsamK
dac64f773d Add support for recovering account with recovery key 2026-09-20 21:54:03 +02:00
AsamK
926cd256e6 Reformat files 2026-09-20 21:14:45 +02:00
AsamK
3d7109eb01 Remove numberless flag in accounts file
This is an edge case and keeping the ACI only account discoverable is
actually the better way to handle it.
2026-09-20 21:14:45 +02:00
Mariusz Woloszyn
d0724fb5b5
Support linking phone-numberless Signal accounts (#2123)
* Support linking phone-numberless Signal accounts

* Align numberless account support with project style

* Support numberless accounts over D-Bus

* Keep superseded accounts out of numberless account discovery

Record numberless accounts explicitly instead of treating every retained ACI
as a discoverable account. Resolve older index entries against saved account
state, preserving ACI lookup and retrying unavailable state on later reads.

The optional index field remains compatible with version 2 readers. Update
native-image reflection metadata and cover replacement, legacy migration,
locked and missing state, and mismatched ACIs in regression tests.

* Address numberless linking review cleanup

Reuse AccountApiV2 through SignalDependencies and use the shared suspend response helper while preserving linking error handling. Remove the unused account-number accessor and unsupported D-Bus version fallback. Keep numberless linking documentation in the man page and point the README to the wiki.

Validate linking errors through HTTP response fixtures. All 196 tests pass on JDK 25 with an isolated D-Bus session; build and JSON schema generation also pass. Account-index classification is unchanged pending review discussion.
2026-09-20 17:51:57 +02:00
AsamK
e1d7bc5587 Return actual error of NonSuccess request result 2026-09-18 22:37:36 +02:00
Dmytro Lomako
c146224493
Add --attachment-dimensions and --attachment-blurhash to send (#2120)
* Accept caller-supplied attachment dimensions

Forward positional WIDTHxHEIGHT metadata supplied by the caller. Validate dimensions before sending and retain automatic image detection for omitted entries.

* Accept caller-supplied attachment BlurHashes

Forward positional BlurHashes supplied by the caller alongside attachment dimensions. Reject BlurHashes whose length doesn't match their size digit.

* Skip image probing when dimensions are supplied

Caller-supplied dimensions replace the probed values, so don't buffer and decode the image to measure it.
2026-09-17 16:58:40 +02:00
AsamK
ff689b577b Fix storage sync edge cases 2026-09-10 19:26:02 +02:00
AsamK
76fee5dda2 Fix handling of unknown storage id types that become known
Fixes #2112
2026-09-10 17:31:00 +02:00
AsamK
089139909b Update libsignal-service 2026-09-10 16:53:14 +02:00
AsamK
f9dbf6bfff Suppress unchecked warnings 2026-09-10 16:34:10 +02:00
AsamK
2c03e5fd8d Reformat files 2026-09-10 16:26:57 +02:00
AsamK
7cc0cc3e0e Prevent storage service loops on ACI identity key changes 2026-09-10 16:26:41 +02:00
AsamK
48731286eb Prevent storage sync loop on PNI-only records with different identity keys 2026-09-10 16:19:21 +02:00
AsamK
3c17e01c37 Fix storage sync issues 2026-08-21 21:39:51 +02:00
AsamK
9605c94f09 Improve contact merging 2026-08-21 20:47:35 +02:00
AsamK
d2f5696df1 Update libsignal-service 2026-08-21 20:35:42 +02:00
AsamK
81e513d6b7 Implement storage sync loop detector 2026-08-21 18:46:03 +02:00
Javair Ratliff
13819c8f09
Support the GroupsV2 "end group" (terminate) feature (#2098)
* Show and enforce the terminated state of a group

A group admin can permanently terminate a group. Afterwards the group is
read-only for everyone, not even an admin can send messages or start calls;
members keep access to the existing history. Other clients silently drop
messages sent to a terminated group.

Read the DecryptedGroup.terminated flag through GroupInfo.isTerminated() and:

- surface it in listGroups (json and plain text) and as the DBus IsTerminated
  group property
- refuse to send to a terminated group locally (messages, reactions, typing and
  group stories) rather than send one that other clients ignore
- drop incoming messages addressed to a terminated group

* Add terminateGroup command to terminate a group for everyone

Let a group admin permanently terminate a GroupV2 group via the
TerminateGroupAction (Groups.proto field 28, change epoch 7) the pinned library
already exposes as GroupsV2Operations.createTerminateGroup().

- GroupV2Helper.terminateGroup builds and commits the change
- GroupHelper.terminateGroup resolves/refreshes the group (v2 only), sends the
  update to members and syncs storage, with the same conflict-retry as
  updateGroup
- exposed through Manager.terminateGroup, the terminateGroup CLI/JSON-RPC command
  and the DBus Group.terminateGroup method

---------

Co-authored-by: FailSpy <FailSpy@users.noreply.github.com>
2026-08-08 17:16:49 +02:00
AsamK
85580d1ff6 Fix graalvm issue with image dimension probing
Fixes #2096
2026-08-04 13:16:58 +02:00
AsamK
3c319f8b4a Reformat files 2026-08-01 09:24:09 +02:00
AsamK
fd3f572499 Use nickname for displaying recipient names 2026-08-01 09:21:52 +02:00
AsamK
854cb35d15 Explicitly store pni signature verified 2026-07-31 13:20:34 +02:00
AsamK
e78521bb5c Always set e164 in sync if available 2026-07-31 13:09:00 +02:00
AsamK
86ad7bf53f Always set the read receipts setting during provisioning if available 2026-07-31 13:08:13 +02:00
AsamK
de5daf0ad4 Cleanup incomplete account data after unsuccessful link
Fixes #2080
2026-07-31 09:01:08 +02:00
AsamK
ecc76ec52b Improve handling of pni change number messages 2026-07-30 22:44:06 +02:00
AsamK
6fa1d1bf90 Fix marking sender as needs pni signature 2026-07-30 22:44:06 +02:00
AsamK
d29f6c1641 Fix removing self from pending group invite via PNI 2026-07-30 22:44:06 +02:00
AsamK
b3e3eda4f7 Use upstream provisioning functionality 2026-07-30 22:44:06 +02:00
AsamK
2cf5e25e9e Implement sticker pack sync 2026-07-29 22:33:49 +02:00
AsamK
151b42c6e9 Update libsignal-service 2026-07-29 22:33:48 +02:00
AsamK
304ffb0e33 Add special handling for file input stream attachments 2026-07-29 19:20:22 +02:00
mikesimone
987832099d
Set width/height on outgoing image attachments (#2093)
createAttachmentStream() never populated SignalServiceAttachmentStream's
width/height fields, even though the Builder has supported them since at
least the currently pinned libsignal-service version. Without them, other
Signal clients render outgoing image attachments as a square-cropped
thumbnail instead of their actual aspect ratio.

Probe dimensions via ImageIO for image/* attachments up to 20MiB (buffered
in memory only for that check) and pass them through to the builder.
Falls back to width/height 0 (today's behavior) for non-images, oversized
files, or anything ImageIO can't parse.
2026-07-29 19:07:06 +02:00
AsamK
89756bb7a7 Refactor group story send 2026-07-12 17:04:32 +02:00
tonycpsu
6808b66897
Add group story support via --group-id (#2083)
* Add group story support to core library layer

Extend Manager.sendStory() with an optional GroupId parameter and add
SendHelper.sendGroupStoryMessage() for endorsement-aware group story
delivery, laying the groundwork for group story support (task 1 of 4).
The existing My Story code path is unchanged.

* Add --group-id support to SendStoryCommand

Passes an optional GroupId through to Manager.sendStory so stories can
be posted to a group instead of only My Story, and surfaces
GroupNotFoundException / NotAGroupMemberException as user errors.

* Update stubs for 3-parameter sendStory and add empty-recipient guard

Updates DbusManagerImpl and StubManager (in SubscribeCallEventsTest) to
match the new 3-parameter sendStory signature: (String attachment,
boolean allowsReplies, Optional<GroupId> groupId).

Also includes the empty-recipient guard added after Task 1 review to
prevent stories from being sent to groups where the user is the only member.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MR2KF56Qcf9qNH1URj3XWs

* Document group story support in man page and changelog

- Add --group-id (-g) option to sendStory command in man page
- Update CHANGELOG to mention group story support via --group-id
- Maintain alphabetical order of options in sendStory section

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MR2KF56Qcf9qNH1URj3XWs

* Address review findings: endorsement safety and error handling

- Filter group story recipients by ACI type and endorsement availability
  to prevent ClassCastException and NPE on edge cases
- Add empty-recipient guard after endorsement filtering
- Skip known-unregistered recipients before address resolution, matching
  the pattern from sendGroupMessageInternal
- Add debug logging when recipients are filtered out
- Fix redundant error message prefixing in SendStoryCommand
- Add .superpowers/ to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MR2KF56Qcf9qNH1URj3XWs

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-12 16:32:40 +02:00
AsamK
fd98cce8b3 Don't send read receipt if disabled in configuration
Only send sync read message in this case
2026-07-12 10:50:43 +02:00
AsamK
e15c29e4e8 Remove old svr2 enclave 2026-07-12 10:10:36 +02:00