Commit Graph

292 Commits

Author SHA1 Message Date
e037e6358c conversation: add case sensitive flag on searchConversation
This allow the search request to be case insensitive by default

Change-Id: I97d0e9c01a2ca311faba7136cfda460ce7ad9957
2022-11-21 10:18:13 -05:00
fa03e232b7 swarm: add reaction support
This is a pretty trivial patch as all the necessary logics are
already supported by the deamon.
A client can use sendMessage with flag = 2 to add a reaction.
This only adds a "react-to" in the body of the message that the
client can interpret.
To remove a reaction, the client can use editMessage (and set the
body to "" for the id of the reaction), also there is no limit
on the content of the reaction and multiple reactions can be added
to the same message.
For non compatible clients, it will be shown as a simple text message
as it's the same type.

Change-Id: I7b13d32771109118b94ed17d0b918e66487e94bb
2022-11-21 10:17:57 -05:00
6855453033 Revert "turn: improve connectivity with unreachable TURN"
Reason for revert: crash

Change-Id: Ibc97ff3edeb40a1bf49df38be35de268da10399b
2022-11-18 19:39:22 -05:00
64ffbffcb5 turn: improve connectivity with unreachable TURN
Initializing a ICE session will need to gather candidates. The TURN
can be long to retrieve, and fails can be really long to detect.
There is at least 3 cases of failures:

+ IPv6 badly configured, which can cause a DNS resolution timeout
of several minutes (that's why the IP was cached)
+ Empty DNS entries, causing a resolution failure
+ A TURN server un-reachable or wrongly configured (e.g. 1.1.1.1)

The idea here is to resolve the TURN and test the connection before
caching it. And use it when cached.
This avoid all resolutions steps and we're basically sure that
it was working.

Other approaches:
+ Add a new callback in pjsip to detect that the TURN is taking too long
to remove it for next calls, but I prefer to not add another patch in
pj and it's not an ideal solution
+ trickle ICE to not wait for all candidates, but this is a big changes
and will generate more DHT messages
+ Do not retransmit messages, but this is against the RFC

Change-Id: Iaec4308bca8cbbbfa4d6b1b6d7a7759b8062a67a
GitLab: #781
2022-11-18 17:12:33 -05:00
87c5f3cef8 misc: fix ut_conversation_call
Change-Id: I6dc0b22f4336dde4db1d6a869e4447ad51d809ff
2022-11-18 15:27:03 -05:00
5b56cc7e42 fileTransfer: massive cleanup
The new logic is there! Swarm is working since some time now, so we can
remove previous logic.

GitLab: #524
Change-Id: I5ca172e9349694d944c9561d97fe8a63d190ebf3
2022-11-18 15:22:23 -05:00
08ef8dd80d swarm: follow user preference for hosting conferences
This avoid mobile phone to host conferences for others unless
explicitly authorized by the user.
Clients can show it via the "hostConference" conversation's preference.

Documentation: https://docs.jami.net/technical/swarm.html#call-in-swarm
GitLab: #312
Change-Id: I9bbd3e394cd1b3bcfd4a3120d9023a5ed686303d
2022-11-17 11:25:10 -05:00
8960936221 swarm: add call support
This patch introduces the ability to start calls and extends the
usage of rendezvous points to swarm with multiple participants.

When starting a call in a swarm with multiple participats, one device
will work as the host of the conference, and the caller will
immediately start the call alone.
Other peers will receive a commit and a notification to be able
to join the active call. To join a call, users needs to call
rdv:uri/device/convId/confId to be added (if authorized) to the conf.

There are some majors differences in the process.
First, every conversation will be able to decide a default host
for conferences. This still needs some design and will be
introduced in another patch. For now, the caller is the host.
Then, because all members of the call may not be interested to join
a call, or they may want to get several calls at the same time, the
system must be able to manage more than one active calls (e.g. a
company with multiple projects can do several standups at the same
time).
Finally, in the conversation, two commits will be generated to be
able to know what active calls are available. The first is
announcing that a conference started, the second announces that
the conference stopped (the host closed the call).
However, this introduces a difficulty. The host may crash and not
commit the end of the call in time. In this case, hostedCalls are
stored in a file and the conversation is updated during the init
of the daemon.

Change-Id: I081a4920edb3773bbed884ae50f34e476ad42094
Documentation: https://docs.jami.net/technical/swarm.html#call-in-swarm
GitLab: #312
2022-11-17 08:10:17 -05:00
1360c775e9 config: use AccountConfig for all Account classes
Change-Id: Ia7dc5c12c91c0b9ea07c41b2de3ac58df7d1239f
2022-11-16 13:58:00 -05:00
ac7ce59c42 connectivity: initial split from jami-related components
As a measure of refactorization of the code and to prepare to the
development of dhtnet, the following changes aims at seperating
jami-specific code to connectivity-specific code.

GitLab: #778
Change-Id: Iaa08100f7d61c80292f039a5aae66819cc85b0e9
2022-11-04 11:00:17 -04:00
412c301f98 call: add media transport information
https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/510#510

Change-Id: Ie09ebd95ba161559c5c08b7e0618d6e87ecca1ee
2022-11-02 09:30:59 -04:00
fe058538fb conversation: do not show error for non critical errors
If an error occurs during the execution of git_remote_fetch, there
is no need to signal any error to the client as it's not a critical
issue (no malformed conversation, mode is recognized, no unauthorized
method) and the sync will be retried later.

Change-Id: I2d875445e51aa6cd78eb2e7dbfe5efb8b2831860
2022-10-31 12:18:16 -04:00
d54a84ec0b Replace DRing for libjami
It's not possible to replace the DRing namespace for jami because of conflicts
with namespaces and classes defined under the jami namespace.  Thus, use libjami
as the namespace.

Script to reproduce:

 rg -l DRing | sort | uniq | awk '$0 !~ /NEWS/' | xargs sed -i -e 's|DRing|libjami|g'
 rg -l DRING_ | sort | uniq | xargs sed -i -e 's|DRING_|LIBJAMI_|g'
 sed -i -e 's|dring|jami|g' src/jami/CMakeLists.txt
 sed -i -e 's|dring|jami|g' src/jami/def.h

Change-Id: I80e8c8b58a7586527a016bbef850bab07869c473
2022-10-29 16:49:27 -04:00
db3e62e415 conversation: fix logUntil
logUntil should retrieve the commits with the commit passed.
Add a LogOptions parameter to avoid too much parameters.

Change-Id: I77a0150b135b14fe44577747d2b1a86cb2cf2509
2022-10-27 15:52:26 -04:00
81da3f7678 conference: fix sinks creation test
The sinks only should be created when there is a video device
available. If no video device is available, no sinks should be
created.

Change-Id: Iec35288bf9966eb664470b2f8c1e5738f6909893
2022-10-25 08:55:42 -03:00
0f6b74b194 conversation: add support for message edition
For now, only be able to edit messages from our-self and with the
text/plain type

Change-Id: I20c6ed7dad3892f0fa655812242b9ca6e77e69b3
GitLab: #316
2022-10-24 14:29:19 -04:00
b28a5cb85d convmodule: avoid incorrect states
In some cases the file "contacts" was badly synced. Also, if for any
reason "contacts" is not correctly formed, we may be able to fix it.

This patch handles two cases of failures:

1. If the contact details doesn't contain any conversationId BUT
a 1:1 conversation is found with this contact, we update the
conversationId in the details.

2. If, for some reason, multiple 1:1 conversations are detected
with the same contact, we only keep the one in the details, as
it should be the correct one.

This should fix the fact that for some conversation, calls are not
written in the history (cause getOneToOneConversation() returns
nothing).

Change-Id: I5dd9fc51999540d8a4230f8fdce828a461da752a
2022-10-21 12:07:05 -04:00
b680c1cb86 unittest: add test to check broken participant
Change-Id: I2e8e7c6ff7da0cb71db135184522e92f25aca0f3
GitLab: #779
2022-10-20 11:52:45 -04:00
483b2b97ae ut_conversation: fix build
Change-Id: I7362b02cc1fd557cf454ccc29d60ff88a53f4afc
2022-10-20 09:26:55 -04:00
190892f425 fix: do not accept new unmuted media
If a new stream is requested, and the client-qt does not specifically
states that it should be not mute, then accept muted media.

GitLab: #770

Change-Id: I1d9d6bdddfb40216d1750d4246e63745773033a6
2022-10-18 09:01:28 -04:00
d570b2b38f conference: add recording to participant infos
So that everybody in the conference can know who is recording

Change-Id: Ibc2d670560c086e2fd1925cab6bb5ea12f563a73
GitLab: #699
2022-10-11 13:45:12 -04:00
a4ff4abe70 swarm: add method to save user's preferences
This store user's preferences per conversation into
conversation_data/<convId>/preferences
In this way, the daemon is able to sync this file across devices
and remove preferences at the same time we remove the conversation.

For now, only support "color" and "ignoreNotifications"

The preferences are synced via partial SyncMsg sent across devices.

Change-Id: I8fe74cc06733ad61d45d721e0264b1941d4cf122
2022-10-06 14:47:30 -04:00
ea327ff28e Rename libring to libjami
Change-Id: Id123f733759d6147f0f8fb9975b21fd8b0f1e558
2022-09-22 10:08:36 -04:00
2bf69dcae8 misc: fix ut_recorder
GitLab: #761

Change-Id: Iebcb1dfed3ebd1919c99e00b9528f3e09a77683c
2022-09-15 10:16:03 -04:00
bcabb5f764 mic: fix conversationMembersEvent
Change-Id: Ib595ab696edddd0271b85933b26c591b078ad21c
2022-09-08 16:45:37 -04:00
cc2f9efb47 misc: fix tests
+ search method was incorrect if no type provided
+ some tests were not waiting for correct signals

Change-Id: If6ba59829defb168f51c4a8e25f2054cd649b8c2
2022-09-08 14:07:31 -04:00
7509c5c311 misc: fix tests build
Change-Id: I238f452f77e10c16ebc5f69bef1b768f44e57e2e
2022-09-07 15:41:23 -04:00
e73a85d0a5 swarm: add a sending status while first fetch
This clarify the UI to know what message was not synced with
someone.

Change-Id: If58b9858eaab4b9f161c5968e691c7fd5531ee97
2022-09-06 14:57:53 -04:00
5eb4d10da7 unitTest/sip_account/sip_empty_offer: Nuke it
This test has not been compiled for a long time.  Even if fixed, the test does
not pass anymore.

Change-Id: I6e14cc42e1874962734c1592e47a780e04080a1f
2022-09-06 11:39:55 -04:00
5f3d6dc4eb unitTest/Makefile: Add AM_TESTS_ENVIRONMENT
This will setup the correct environment for each tests and echo tests that are
running.  Users can extend this with the TESTS_ENVIRONMENT variable.

Change-Id: I7aa0f04721251a6ea48cb4c2e7c2238f95d67267
2022-09-06 11:39:55 -04:00
2b19b69f91 plugins: use JAMI_LANG variable
To apply translations, first try to read if the JAMI_LANG variable is
set, if not, try to get the system language.

GitLab: #747

Change-Id: Ie458abcc07c0d0fd151172e172fe1418e5f06e7f
2022-09-06 11:26:20 -04:00
5af1041bf8 proposal: swarm: use log to search messages in conversations
This gives to clients the ability to perform search for messages
with several parameters (account's id, conversation's id, author,
period, max number).
(To discuss) This patch introduces the search API, and a signal
(MessagesFound) to return a result.

GitLab: https://git.jami.net/savoirfairelinux/jami-project/-/issues/1382
Change-Id: Ibc4665449fa0da71a015d1d18d6d0d3209331d43
2022-09-06 09:32:08 -04:00
a835266fbb unittest: add plugins
Create a minimal test for the plugins system.

GitLab: #745

Change-Id: I17d48860ce24cfdc5423d4dcc3cb44bb4d4531f6
2022-09-01 10:38:48 -03:00
0b652eb787 jamiaccount: resend profile when necessary
+ Some code were unused
+ Ask for profiles in one to one after a clone, this
allow to get the profile after adding/removing/re-adding
the contact as the peer will not know and got a cache
where they sent the avatar before.
+ Update unit-test

Change-Id: Ide1df647dbec63f343b60c1c622d1a214f4c3016
2022-08-30 20:59:06 -04:00
cb3d3c3c85 swarm: avoid duplicated conversation after a ban
Several improvements are included with this patch:

1. confirmed is resetted when account is removed, this allow to
send a request when conversation is added back and reset the
whole matrix, avoiding duplicates
2. Banned can be due to harrasement. In this case, keeping the
conversation like the old behavior (pre-swarm) is better, to keep
proofs. Also re-adding back a contact is immediate if it was a
mistake as the conversation is kept back.

https://git.jami.net/savoirfairelinux/jami-project/-/issues/1449

Change-Id: I13da8ce9bd431b91ce7b7d455dae561358c62f10
2022-08-24 10:46:22 -04:00
1f77dce51a removeContact: actually close all channels not only SIP
Removing a contact was not actually closing all connections, causing
the remote contact to be able to call even if it was banned if there
was more than two channels opened.
Rewrite closeConnectionsWith as it was unused to use it to close
connections with the banned contact.

https://git.jami.net/savoirfairelinux/jami-project/-/issues/1449

Change-Id: I147f437370a553f0682b0cea060720a6c473f8a2
2022-08-24 09:34:36 -04:00
626b563867 tests: re-enable conversation's tests
Change-Id: I3eaa39c81fe816e3149ae8599fb8e95f84e18bc0
2022-08-16 09:16:33 -04:00
521107ed5a swarm: do not send message displayed notification if unneeded
Change-Id: Iafc78c75cc935bd7b91f39cbd43159f1a7eeaa02
2022-08-11 12:38:52 -04:00
3bc5888fe2 connectionmanager: announce non ready channel on shutdown
This is useful for the conversation_module if any channel is pending
while shutting down, as the previous fetch status was not updated.
More generally, every connectDevice() should call the associated
callback.

Add a unit test to replicate this scenario.

Change-Id: I72f2975dc15dd4bac3f55c2f899ebb1ae5a7a7f3
2022-08-08 14:09:28 -04:00
e74fa6247d misc: fix ut_conversationRequest
bad CPPUNIT_ASSERT and timing issue

Change-Id: I16267d00325ebc1875cb4a92f73eaefb50614f99
2022-08-02 18:23:16 -04:00
d352fb8f19 cleanup: remove downgrade to non swarm
Now that it's been months since all clients supports swarm, we
can assume that everybody is using a version compatible with
swarm now.
So, downgrading conversations to a non swarm if a DHT message
comes is not necessary and it's just unwanted code.

Change-Id: I83b83d592ea43219cbdecb31fa8b5a71b897e487
GitLab: #312
2022-07-29 11:41:18 -04:00
dca84be45c swarm: add ability to answer to a message
GitLab: #318
Change-Id: I12c04096a91c40b5e6c9c435373cce23b4065d7e
2022-07-25 16:42:19 -04:00
9ddc0c111d conversationrepository: fix commit validation for un-banning contacts
After a re-add of an invited contact, the validation was bugguy causing
the conversation to be invalidated and erased due to malformed commits

Change-Id: Ib500ae117f0c53774cfb1eec23aa160ba2f86420
2022-07-22 14:05:03 -04:00
45baff6a4c jamiaccount: remove connections and data on banned
A contact can be banned from another device. In this case,
JamiAccount::removeContact is not called and the daemon only call the
dedicated callback.
So, remove the conversation requests and connections to the banned
contact (and avoid future incoming calls if connected) when the
callback is called instead in JamiAccount::removeContact() as it
will be called in a multi-device context.

Change-Id: I1ac8b441268d7bfc9bb6627fbbbc7b83e2e75052
2022-07-22 14:04:38 -04:00
e6f995d746 conversation: add signal for profile updates
Change-Id: Ibfa6759b19ba240115ef36412cc8a1ed7bd6cd41
2022-07-21 13:51:24 -04:00
405ea9ee59 siptransport: fix tlsInfos_
sipTransport was only true on destroy, causing tlsInfos_ to be
always incorrect.
Moreover, if the SIPTransport is generated from a channeled socket,
we do not need to copy the peerCertificate.
Finally, update conference to use the tlsInfos_ to get the URI
instead of playing with peerNumber's

Change-Id: If8b93a4614e790e6ffbfd1bcc0aa68f6407344ce
2022-07-18 11:34:43 -04:00
578036c496 swarm: correctly avoid multiple 1:1 with same contact
In the contact list, receiving a confirmed request for a non-active
contact would re-add the contact.  If the contact was removed then
re-added, the conversation would be badly updated & removed, instead
of replacing the conversation by the old one.

Finally, remove the replaced conversation after the clone of the
new one, to avoid making the contact disappear while cloning.

Add some tests to validate the scenarios.

Change-Id: I67a94604c5869804ed66b390aa26cca9420fbc28
2022-07-18 08:11:54 -04:00
3e029a9b04 misc: fix unit tests
+ Bump deamon version to enable multistream
+ use signal for recorder to check if file stopped
+ answerMediaChangeRequest pass isRemote for tests

Change-Id: I396b8246264cb7826350f75e74f20f05b864f384
2022-07-14 13:31:35 -04:00
99b32015da sync: fix sync after re-adding a contact previously removed
If a conversation was previously removed, it couldn't be re-cloned
due to the fact that the sync value can come from a previously
offline device.
Like updateContact in contact_list, use created/removed to determine
if it's a re-added contact to be able to re-sync again.

Change-Id: Ibe16d2bda02cbbe41b16d8b365d9c8ef02b36140
2022-07-13 12:03:43 -04:00
e2136e48b3 cleanup: remove srcType_
As unused and duplicates informations

Change-Id: I4c98328339bd4149206ac88d9af456418960838f
2022-07-13 09:27:15 -04:00