Skip to content

Add --timestamp option to send command - #2147

Merged
AsamK merged 2 commits into
AsamK:masterfrom
tonycpsu:send-custom-timestamp
Nov 7, 2026
Merged

AsamK merged 2 commits into
AsamK:masterfrom
tonycpsu:send-custom-timestamp

Conversation

@tonycpsu

Copy link
Copy Markdown
Contributor

Closes #1390.

Adds an optional --timestamp to send (and a timestamp param over JSON-RPC), so the caller can choose the message timestamp instead of having signal-cli generate one. Signal clients identify a message by its author and timestamp, so this lets a caller know the timestamp before the send returns, or reuse the timestamp of an earlier attempt.

Behaviour

  • The value is milliseconds since the epoch, and must be positive and strictly in the past. A supplied timestamp does not update the last generated timestamp (lastMessageTimestamp), so a value equal to the current time could be the same as the one generated for a concurrent send.
  • It is rejected (not ignored) together with --edit-timestamp or --end-session, and over D-Bus, whose interface has no field for it. In the library, Message gets an optional timestamp, and sendEditMessage rejects a message that has one.
  • The returned timestamp is the supplied one.
  • Without the option, nothing changes: the timestamp is generated as before.
  • Only send gets the option. Other sending commands (reactions, remote delete, polls, pins, stories, …) keep generating their own timestamp.

Usage

signal-cli -a ACCOUNT send -m "hello" --timestamp 1760000000000 +491234567890
{"jsonrpc":"2.0","method":"send","params":{"recipient":["+491234567890"],"message":"hello","timestamp":1760000000000},"id":1}

Tests

  • SendCommandParsingTest (12 new tests): the value reaching the sent Message from the CLI and from JSON-RPC (as Long and Integer), omitted value unchanged, zero, negative, future and non-integer values rejected, the --edit-timestamp / --end-session rejections, and the bounds of parseMessageTimestamp (null, just before now, equal to now, BigInteger / Double / String).
  • ./gradlew build passes (:test 72 tests, :libsignal-cli:test 171 tests, 0 failures).

πŸ€– Generated with Claude Code

https://claude.ai/code/session_014BxcotxHKb9ZNJkezZgmnQ

tonycpsu and others added 2 commits October 13, 2026 23:27
Let the caller choose the timestamp of a sent message instead of using
the current time. Signal clients identify a message by its author and
timestamp, so this lets a caller know the timestamp before the send
returns, or reuse the timestamp of an earlier attempt.

The value must be positive and strictly in the past. A supplied
timestamp does not update the last generated timestamp, so a value equal
to the current time could be the same as the one generated for a
concurrent send.

The option is rejected together with --edit-timestamp or --end-session,
and over D-Bus, which has no way to pass it.

Closes AsamK#1390

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AsamK
AsamK merged commit d4330a4 into AsamK:master Nov 7, 2026
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add custom message timestamp option to the send command

2 participants