Commit graph

69 commits

Author SHA1 Message Date
AsamK
d08508e6ef Move Exception classes to corresponding package 2020-05-15 20:03:51 +02:00
AsamK
d520023fc7 Refactor Manager and SignalAccount to implement Closeable
Should make sure that file lock and web socket connections are closed
reliably.
2020-05-13 23:33:40 +02:00
AsamK
87f65de0c5 Save account state after ending session even if sending the message has failed 2020-05-11 18:31:22 +02:00
AsamK
a02031aa80 Refactor Manager to always have a valid SignalAccount instance
Extract ProvisioningManager to link new devices
2020-05-11 18:07:37 +02:00
AsamK
8163a42d3a Split manager ServiceConfig from BaseConfig 2020-05-11 14:51:55 +02:00
AsamK
916d0e3cf1 Don't send group info request after receiving QUIT for unknown group
The sender has quit the group so he won't respond to the info request anyway
2020-05-07 12:41:49 +02:00
AsamK
26840a2f0f Update dependencies 2020-05-06 20:11:26 +02:00
AsamK
00777a469c Switch to hypfvieh dbus-java
Removes transitive dependency on libmatthew-unix-java

Fixes #285
2020-05-06 09:13:49 +02:00
AsamK
08749fcee0 When sending an end session message clear local session store also if sending message fails 2020-04-21 20:36:28 +02:00
AsamK
19b01ff2e9 Also catch IllegalArgumentException when sending messages during receive
It's necessary to keep receiving messages if a session state is corrupted.
e.g:
Exception in thread "main" java.lang.IllegalArgumentException: Empty key
        at java.base/javax.crypto.spec.SecretKeySpec.<init>(Unknown Source)
        at org.whispersystems.libsignal.ratchet.ChainKey.getBaseMaterial(ChainKey.java:57)
        at org.whispersystems.libsignal.ratchet.ChainKey.getMessageKeys(ChainKey.java:47)
        at org.whispersystems.libsignal.SessionCipher.encrypt(SessionCipher.java:97)
        at org.signal.libsignal.metadata.SealedSessionCipher.encrypt(SealedSessionCipher.java:70)
        at org.whispersystems.signalservice.api.crypto.SignalServiceCipher.encrypt(SignalServiceCipher.java:86)
        at org.whispersystems.signalservice.api.SignalServiceMessageSender.getEncryptedMessage(SignalServiceMessageSender.java:1456)
        at org.whispersystems.signalservice.api.SignalServiceMessageSender.getEncryptedMessages(SignalServiceMessageSender.java:1406)
        at org.whispersystems.signalservice.api.SignalServiceMessageSender.sendMessage(SignalServiceMessageSender.java:1276)
        at org.whispersystems.signalservice.api.SignalServiceMessageSender.sendReceipt(SignalServiceMessageSender.java:206)
        at org.asamk.signal.manager.Manager.sendReceipt(Manager.java:686)
        at org.asamk.signal.manager.Manager.handleMessage(Manager.java:1562)
        at org.asamk.signal.manager.Manager.receiveMessages(Manager.java:1496)
        at org.asamk.signal.commands.ReceiveCommand.handleCommand(ReceiveCommand.java:160)
        at org.asamk.signal.Main.handleCommands(Main.java:137)
        at org.asamk.signal.Main.main(Main.java:60)
2020-04-21 20:33:23 +02:00
AsamK
ae41d0c502 Output json when receiving messages from dbus and --json parameter is given
Fixes #138
2020-04-03 16:22:10 +02:00
AsamK
f51f0cbbcf Return message timestamp after sucessfully sending a message
Fixes #104
2020-04-03 14:02:18 +02:00
AsamK
320e126eeb Add RecipientStore to resolve all identifiers to SignalServiceAddress
Should fix #290
2020-04-03 13:22:36 +02:00
AsamK
e684a902bb Update dependencies 2020-03-30 22:00:41 +02:00
AsamK
ff18b1bf99 Get untrusted identity from inner exception
Fixes #283
2020-03-29 14:45:11 +02:00
AsamK
7e5aec6e15 Store uuids in identity and session store 2020-03-29 13:32:45 +02:00
AsamK
286070c054 Use legacy sender certificate, until uuid support is complete 2020-03-25 20:34:12 +01:00
AsamK
5df8f32820 Mark our own identity key as trusted initially
to match Signal-Android behavior
2020-03-24 18:16:05 +01:00
AsamK
995de3ef5b Improve behavior, when authorization fails
- register command should still be possible, to regain authorization
- reset uuid after registering, otherwise the verify request will fail
2020-03-24 18:15:21 +01:00
AsamK
efa1c43b0b Get uuids from contact store when resolving numbers 2020-03-24 14:36:12 +01:00
AsamK
26aa31edc2 Only send our profile key to recipient who are in our contact list 2020-03-24 14:36:12 +01:00
AsamK
20bf605e36 Only store our own profile key in contact list, if a contact entry already exists 2020-03-24 14:36:12 +01:00
AsamK
6665dc0e48 Set uuid after verify and linking and request it at startup for existing clients 2020-03-24 14:36:12 +01:00
AsamK
1b56485fc8 Send delivery receipt for data messages that need it
With the unidentified sender messages, the Signal server cannot do this
automatically anymore.
2020-03-23 20:51:13 +01:00
AsamK
b62694dbc7 Remove ThreadStore and store message expiration time in group/contact store
To match the implemenation of Signal-Android
2020-03-23 20:51:13 +01:00
AsamK
f982d2752e Store group member uuids in group store
The member list is now stored as a mixed list of strings and objects, e.g.:
"members": [ "+XXXX", { "number": "+XXXX", "uuid": "XXX-XX" } ]
2020-03-23 20:51:13 +01:00
AsamK
a4e1d69788 Store contact uuids in contact store 2020-03-23 17:43:37 +01:00
AsamK
e2b7bda65b Use SignalServiceAddress in more places 2020-03-23 17:09:56 +01:00
AsamK
4ff28458ff Refactor sticker upload 2020-03-23 14:49:21 +01:00
Signal Stickers
23845eab47 Add support for uploading stickers.
Closes #256
2020-03-23 14:49:17 +01:00
AsamK
bb06ae9d9a Mark group as active when the user hasn't left it
Fixes #269
2020-03-22 18:27:29 +01:00
AsamK
67f6378f7f Fix storing received profile keys 2020-03-22 17:17:28 +01:00
AsamK
a6562b3b7b Implement sending messages using unidentified sender 2020-03-22 17:17:14 +01:00
AsamK
d7f7c84e6c Fix some inspection issues 2020-03-21 14:41:11 +01:00
AsamK
0dc6b1327e Update libsignal-service-java
- Use new ProfileKey class instead of byte array
- Add capabilities (for future support of uuid and groups v2)
2020-03-21 14:37:02 +01:00
AsamK
063fb95dca Add command sendReaction for emoji reactions 2020-02-22 11:29:17 +01:00
AsamK
37ed02f4ce Update to libsignal 2.15.3_unofficial_2 2020-02-12 20:36:23 +01:00
Daniel Schäufele
8b9640ba14 Add support for blocking contacts and accounts (#260)
* Add blockContact and unblockContact subcommands

* Send blocked status in contacts sync

* Use only one method for blocking and unblocking

* Add blocking/unblocking for groups

* Prevent blocked messages from being printed

* Print blocked property in listContacts and listGroups commands

* Handle BlockedListMessages

* Store blocked state from incoming contact and group sync messages

* Minor changes and corrections

* Add block and unblock commands to man file (and also fix some headings of commands)
2020-01-22 08:39:28 +01:00
AsamK
7f9379f78b Canonicalize number when listing identities 2020-01-21 22:09:21 +01:00
AsamK
cfd1e5544d Canonicalize number before getting/setting contact info 2020-01-21 22:08:16 +01:00
AsamK
eca1737d28 Upload attachment before sending to fix sending attachments to multiple recipients
Fixes #259
2020-01-21 20:32:52 +01:00
AsamK
4bafc7212a Update copyright notice 2020-01-21 20:32:19 +01:00
AsamK
3b2682a57a Display more information for received messages 2019-12-31 13:02:49 +01:00
AsamK
6cfddc0aff Improve SignalServiceAddress handling 2019-12-30 16:47:12 +01:00
signal-stickers
85025d2e25 Update to libsignal 2.15.3 (#255) 2019-12-30 16:25:12 +01:00
VisibleCode
e508fc50e9 Add listContacts subcommand (#248) 2019-12-03 21:57:27 +01:00
AsamK
df81911e44 Extract getMessageReceiver method 2019-11-11 21:24:04 +01:00
Jérémy Bobbio
53e7f83188 Add commands to update contact names on Signal servers
As Signal Desktop does not allow its users to update the contact names,
it would be nice to be able to update contact names from signal-cli when
the latter is the master device.

The command `setContactName` allow to set the name for the given contact
in the local store. `sendContacts` can then be used to push the updated
contact list on Signal servers.

Closes #228
2019-10-16 19:27:42 +02:00
AsamK
b2efef4d8c Reformat imports 2019-10-16 19:27:42 +02:00
AsamK
958d10fcd1 Merge profile commands to a single UpdateProfileCommand 2019-10-16 19:27:42 +02:00