Commit Graph

7710 Commits

Author SHA1 Message Date
Daniel Calviño Sánchez
ddd451dadb
Queue data channel messages sent when data channel is not open
Data channel messages can be sent only when the data channel is open.
Otherwise the message is simply lost. Clients of the
PeerConnectionWrapper do not need to be aware of that detail or keep
track of whether the data channel was open already or not, so now data
channel messages sent before the data channel is open are queued and
sent once the data channel is opened.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-01-03 10:52:42 +01:00
Daniel Calviño Sánchez
7cfee8f848
Split condition
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-01-03 10:52:42 +01:00
Daniel Calviño Sánchez
bcd3893e7d
Rewrite method to return early
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-01-03 10:52:42 +01:00
Daniel Calviño Sánchez
c222e01095
Move variable declaration into try block
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-01-03 10:52:41 +01:00
Daniel Calviño Sánchez
4d4b8832aa
Fix remote data channels not disposed when removing peer connection
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-01-03 10:52:41 +01:00
Daniel Calviño Sánchez
c940175453
Send data channel messages using "status" data channel
Data channel messages are expected to be sent using the "status" data
channel that is locally created. However, if another data channel was
opened by the remote peer the reference to the "status" data channel was
overwritten with the new data channel, and messages were sent instead on
the remote data channel.

In current Talk versions that was not a problem, and the change makes no
difference either, because since the support for Janus 1.x was added
data channel messages are listened on all data channels, independently
of their label or whether they were created by the local or remote peer.

However, in older Talk versions this fixes a regression introduced with
the support for Janus 1.x. In those versions only messages coming from
the "status" or "JanusDataChannel" data channels were taken into
account. When Janus is not used the WebUI opens the legacy
"simplewebrtc" data channel, so that data channel may be the one used to
send data channel messages (if it is open after the "status" data
channel), but the messages received on that data channel were ignored by
the WebUI. Nevertheless, at this point this is more an academic problem
than a real world problem, as it is unlikely that there are many
Nextcloud servers with Talk < 16 and without HPB being used.

Independently of all that, when the peer connection is removed only the
"status" data channel is disposed, but none of the remote data channels
are. This is just a variation of an already existing bug (the last open
data channel was the one disposed due to being the last saved reference,
but the rest were not) and it will be fixed in another commit.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-01-03 10:52:41 +01:00
Daniel Calviño Sánchez
a4cce0581c
Rename "sendChannelData" to "send"
The legacy name was a bit strange, so now it is renamed to just "send"
as the parameter type ("DataChannelMessage") gives enough context.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-01-03 10:52:41 +01:00
Daniel Calviño Sánchez
1f872553b9
Include data channel label in log message
This implicitly fixes trying to send the initial state on the latest
remote data channel found (which is the one stored in the "dataChannel"
attribute of the "PeerConnectionWrapper") when any other existing data
channel changes its status to open. Nevertheless, as all this will be
reworked, no unit test was added for it.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-01-03 10:52:40 +01:00
Daniel Calviño Sánchez
4daadc508c
Unify log messages for received data channel messages
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-01-03 10:52:40 +01:00
Daniel Calviño Sánchez
08630790b7
Add unit tests for receiving data channel messages
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-01-03 10:52:40 +01:00
Daniel Calviño Sánchez
ed69d96a43
Add dummy Log implementation to be used in tests
Log methods are static, so they can not be mocked using Mockito.
Although it might be possible to use PowerMockito a dummy implementation
was added instead, as Log uses are widespread and it is not something
worth mocking anyway.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-01-03 10:52:40 +01:00
Daniel Calviño Sánchez
d34fdfb1c5
Remove Dagger related code from PeerConnectionWrapper
The PeerConnectionWrapper does not need to be injected in the
application, nor the Context needs to be injected in the
PeerConnectionWrapper. This all seems to be leftovers from the past, and
removing them would ease adding unit tests for the
PeerConnectionWrapper.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2025-01-03 10:52:39 +01:00
Nextcloud bot
a65b52b0e5
Fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2025-01-03 03:03:50 +00:00
Nextcloud Android Bot
e5d946d973 Weekly 21.0.0 Alpha 07 2024-12-30 03:10:49 +00:00
Nextcloud bot
b0658caea2
Fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2024-12-28 03:04:16 +00:00
Nextcloud bot
9630fc130d
Fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2024-12-27 03:04:12 +00:00
Nextcloud bot
d092f03c96
Fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2024-12-26 03:04:24 +00:00
Nextcloud bot
bc5a289ee5
Fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2024-12-25 03:03:55 +00:00
Nextcloud bot
97e4e3aa90
Fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2024-12-24 03:02:01 +00:00
Nextcloud Android Bot
3a85f146b1 Weekly 21.0.0 Alpha 06 2024-12-23 03:12:34 +00:00
Nextcloud bot
e7e6e421b0
Fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2024-12-23 03:01:48 +00:00
Nextcloud bot
127034fe33
Fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2024-12-22 03:18:49 +00:00
Andy Scherzinger
62d1eeafce
fix(ktlint): correct code formatting
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-12-21 16:50:40 +01:00
Nextcloud bot
144ccc4106
Fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2024-12-21 03:03:23 +00:00
renovate[bot]
85efdd5a7b
Update daggerVersion to v2.54
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-20 20:03:07 +00:00
github-actions[bot]
7e5755325d
Merge pull request #4561 from nextcloud/renovate/kotlinx-coroutines-monorepo
Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-test to v1.10.1
2024-12-20 16:46:48 +00:00
renovate[bot]
153e2dcfb5
Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-test to v1.10.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-20 16:31:35 +00:00
Marcel Hibbe
c86769d0e3
Merge branch 'master' into master
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2024-12-20 17:14:33 +01:00
Marcel Hibbe
74da67210d
resolve detekt warnings 2024-12-20 15:44:24 +01:00
Marcel Hibbe
cd50115e06
fix detekt warnings
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2024-12-20 14:59:25 +01:00
sowjanyakch
74bf9f2e91
hide replacement view when there is no replacement set
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:53 +01:00
sowjanyakch
f7078990d9
use constants
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:53 +01:00
sowjanyakch
65cb31b1e7
ktlintFormat
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:53 +01:00
sowjanyakch
8ca769832d
use theming from server
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:53 +01:00
sowjanyakch
3eab18472f
format code and remove unused colors
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:53 +01:00
sowjanyakch
cadb12cd0f
join 1:1 conversation with replacement user
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:52 +01:00
sowjanyakch
9a481aefc8
create chip for avatar icon and name
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:52 +01:00
sowjanyakch
ca4ace687c
use proper color for out of office view
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:52 +01:00
sowjanyakch
a9168b3f9d
format code
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:52 +01:00
sowjanyakch
27538a77ff
remove unused namespace declaration
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:52 +01:00
sowjanyakch
e7c540870b
ui changes to out_of_office_view
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:52 +01:00
sowjanyakch
4bdedfbc0d
show userAbsence period
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:51 +01:00
sowjanyakch
ecd5bfdf41
apply styling
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:51 +01:00
sowjanyakch
c9d5bc68a2
show replacement only if the user set a replacement
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:51 +01:00
sowjanyakch
083f0de063
use proper naming
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:51 +01:00
sowjanyakch
f7f73136d8
modify data class UserAbsenceData
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:51 +01:00
sowjanyakch
07accbb2b9
Use conversation name as userId in API call
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:51 +01:00
sowjanyakch
e6e294096b
call API only when status is in DND mode
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:50 +01:00
sowjanyakch
10e88f1e17
display out of office message in ChatActivity
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:50 +01:00
sowjanyakch
6bcd24bf56
add out_of_office_view.xml
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2024-12-20 10:59:50 +01:00