Commit graph

5909 commits

Author SHA1 Message Date
Daniel Calviño Sánchez
473b8b238d
Extract interface to send signaling messages
Like done with SignalingMessageReceiver, an implementation specific to
each signaling server type (internal or external) is added.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-27 14:28:57 +01:00
Daniel Calviño Sánchez
6b032fc55a
Replace constant String of length 1 with character
Fixes UCPM_USE_CHARACTER_PARAMETERIZED_METHOD issue from SpotBugs.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-27 14:28:57 +01:00
Daniel Calviño Sánchez
4086499a32
Remove special method to request offers
As the "requestoffer" message is just a signaling message the generic
method can be used instead.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-27 14:28:57 +01:00
Daniel Calviño Sánchez
37db855170
Use generic message rather than specific one for requesting offers
"requestoffer" messages are compatible with the generic messages, so for
simplicity the generic message is used now instead of having specific
classes just for it.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-27 14:28:56 +01:00
Daniel Calviño Sánchez
95007882f4
Remove no longer used JSON model
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-27 14:28:56 +01:00
Daniel Calviño Sánchez
48a64fde7e
Fix message wrapper type in documentation
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-27 14:28:56 +01:00
Daniel Calviño Sánchez
b4d4cdf219
Remove unused wrapper in the internal signaling server
Messages sent to the internal signaling server need to be serialized
twice, first the signaling message and then the wrapper as a whole. Due
to this the NCMessageWrapper was not actually used.

For simplicity the manual serialization was kept rather than adding
something like "NCMessageWrapperToSend" where a serialized signaling
message could be set before serializing it.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-27 14:28:56 +01:00
Daniel Calviño Sánchez
e1eca7764f
Replace wrapper with actual message in external signaling server
NCMessageWrapper is used only for messages sent and received by the
internal signaling server. However, it is unused by the external
signaling server, except for getting the NCSignalingMessage, which is
the common message for both signaling servers.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-27 14:28:55 +01:00
Andy Scherzinger
3dac8fb9ce
Merge pull request #2653 from nextcloud/dependabot/github_actions/actions/stale-7.0.0
Bump actions/stale from 6.0.1 to 7.0.0
2022-12-27 10:07:57 +01:00
Andy Scherzinger
50549ae652
Merge pull request #2654 from nextcloud/dependabot/github_actions/ossf/scorecard-action-2.1.2
Bump ossf/scorecard-action from 2.1.1 to 2.1.2
2022-12-27 10:06:02 +01:00
Nextcloud bot
5fe33f47a1
Fix(l10n): 🔠 Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-12-27 07:13:47 +00:00
Nextcloud bot
df0baba6e2
Fix(l10n): 🛠️ Update Transifex configuration
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-12-27 07:12:37 +00:00
dependabot[bot]
a221500ba3
Bump ossf/scorecard-action from 2.1.1 to 2.1.2
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](15c10fcf1c...e38b1902ae)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-26 23:03:16 +00:00
dependabot[bot]
2158bae4e7
Bump actions/stale from 6.0.1 to 7.0.0
Bumps [actions/stale](https://github.com/actions/stale) from 6.0.1 to 7.0.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](5ebf00ea0e...6f05e4244c)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-26 23:03:13 +00:00
Nextcloud bot
4e86f450f2
Fix(l10n): 🔠 Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-12-26 06:52:45 +00:00
Nextcloud bot
cd787ae8aa
Fix(l10n): 🛠️ Update Transifex configuration
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-12-26 06:51:52 +00:00
Nextcloud Android Bot
198a9e3145 Weekly 15.2.0 Alpha 03 2022-12-26 03:12:55 +00:00
Nextcloud bot
5e276fef80
Fix(l10n): 🔠 Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-12-25 07:52:26 +00:00
Nextcloud bot
7bbac1e823
Fix(l10n): 🛠️ Update Transifex configuration
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-12-25 07:50:59 +00:00
Nextcloud bot
98d6132416
Fix(l10n): 🔠 Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-12-24 09:56:54 +00:00
Nextcloud bot
588a64b778
Fix(l10n): 🛠️ Update Transifex configuration
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-12-24 09:55:01 +00:00
Marcel Hibbe
93137e1eeb
Merge pull request #2536 from nextcloud/add-listeners-for-signaling-messages
Add listeners for signaling messages
2022-12-23 21:48:24 +01:00
Daniel Calviño Sánchez
c4c64df5a6 Remove no longer needed code after removing EventBus message
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:44:41 +01:00
Daniel Calviño Sánchez
5e224c5a24 Use listener for participant list messages
Note that the thread used to handle the participant list messages from
the external signaling server does not change; the EventBus subscriber
mode was "BACKGROUND", but as the message was posted from a WebSocket
handler, which runs in a worker thread rather than in the main thread,
the subscriber was executed in the same thread as the poster.

Also note that the removed "userId" remark was not fully accurate;
although some external signaling messages do actually use "userid" those
currently handled to process the users do not, they always use "userId"
(as documented in the SignalingMessageReceiver).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:44:41 +01:00
Daniel Calviño Sánchez
e0c676bb35 Add listener for participant list messages
For now only the same participant list messages that were already
handled are taken into account, but at a later point further messages,
like participants joining or leaving the conversation, could be added
too.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:44:41 +01:00
Daniel Calviño Sánchez
c8e77c3d3b Split message receiver for internal and external signaling servers
Note that the thread used to handle and notify messages from the
external signaling server does not change; the EventBus subscriber mode
was "BACKGROUND", but as the message was posted from a WebSocket
handler, which runs in a worker thread rather than in the main thread,
the subscriber was executed in the same thread as the poster.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:44:41 +01:00
Daniel Calviño Sánchez
9df56dccda Process signaling message directly in the SignalingMessageReceiver
This will no longer log an error if the room type of the received
message is neither "video" nor "screen". However, that should never
happen, and it would be useful only while debugging, so it is fine to
lose that.

Note that the check is not added to SignalingMessageReceiver itself to
keep it as generic as possible (and due to the low value of adding it as
explained above). Nevertheless, if needed in the future it would be
possible to add a special listener that receives raw messages in order
to validate them and log the errors, if any.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:44:20 +01:00
Daniel Calviño Sánchez
bda7d2719b Add listener for call participant messages
Although "unshareScreen" is technically bound to a specific peer
connection it is instead treated as a general message on the call
participant.

Nevertheless, call participant messages will make possible (at a later
point) to listen to events like "raise hand" or "mute" (which, again,
could be technically bound to a specific peer connection, but at least
for now are treated as a general message on the call participant).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:41:34 +01:00
Daniel Calviño Sánchez
d42fe61e89 Add listener for offer messages
Unlike the WebRtcMessageListener, which is bound to a specific peer
connection, an OfferMessageListener listens to all offer messages, no
matter which peer connection they are bound to. This can be used, for
example, to create a new peer connection when a remote offer for which
there is no previous connection is received.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:40:01 +01:00
Daniel Calviño Sánchez
476fb59a08 Use temporary SignalingMessageReceiver implementation in CallActivity
Eventually all signaling related code should be moved to a Signaling
class that abstracts the differences between the internal and external
signaling servers, including how messages are sent and listened to. In
the meantime a temporary SignalingMessageReceiver implementation is
added to CallActivity to be able to start using it.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:40:01 +01:00
Daniel Calviño Sánchez
45787caf0a Add SignalingMessageReceiver class to listen to signaling messages
For now only WebRTC messages can be listened to, although it will be
extended with other kinds later.

This commit only introduces the base class, although it is not used yet
anywhere; a concrete implementation will be added in a following commit.

The test class is named "SignalingMessageReceiverWebRtcTest" rather than
just "SignalingMessageReceiverTest" to have smaller, more manageable
test classes for each listener kind rather than one large test class for
all of them.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:40:01 +01:00
Daniel Calviño Sánchez
0e36002036 Hide and delete no longer needed public methods
Although the rest of the methods are no longer needed since the handling
of WebRTC messages was moved to PeerConnectionWrapper "setSessionId()"
was not needed even before that.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:40:01 +01:00
Daniel Calviño Sánchez
4dffd29ceb Move handling of WebRTC messages to PeerConnectionWrapper
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:40:01 +01:00
Daniel Calviño Sánchez
f3e04b8e18 Simplify condition
"peerConnectionWrapper" needs to be defined to enter the if and execute
the switch, so just return before the switch if "peerConnectionWrapper"
is null.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:40:01 +01:00
Daniel Calviño Sánchez
075ba20cf9 Split handling of "unshareScreen" and WebRTC messages
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:40:01 +01:00
Daniel Calviño Sánchez
7b1bfb2c17 Simplify getting the message type
The message type is set for all signaling messages. On the other hand,
the payload type is only set for offers and answers (and, if the message
was sent by the Android app, also for candidates). However, in all those
cases the payload type just duplicates the message type, so the message
type can be assigned directly rather than falling back to it if there is
no payload type.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 20:39:49 +01:00
Andy Scherzinger
55d923394c
Merge pull request #2646 from nextcloud/chore/analysis-summary
Analysis: Also publish summary to GITHUB_STEP_SUMMARY
2022-12-23 13:55:59 +01:00
Andy Scherzinger
dac2558111
analysis: Also publish summary to GITHUB_STEP_SUMMARY
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Co-Authered-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
2022-12-23 12:43:28 +01:00
Marcel Hibbe
dfa2b66eec
Merge pull request #2586 from nextcloud/fix-joining-call-when-signaling-messages-overtake-the-response
Fix joining call when signaling messages overtake the response
2022-12-23 12:19:06 +01:00
Daniel Calviño Sánchez
331bf49f73 Fix processing of participant list on reconnections
When the HPB is used the signaling messages can be received even when
the local participant is not currently in the call (for example, when
starting the call timed out without other participant joining, or when
reconnecting due to the publisher connection failing). Therefore if the
local participant is not in the call it should not try to establish a
connection with the other participants and disconnect them instead.

Moreover, if the connection is tried to be established when not
in the call the HPB will prevent that, and the PeerConnectionWrapper
will stay in a limbo state waiting for an offer to be sent. If the local
participant then joins the call the PeerConnectionWrapper will already
exist for the other participants, so no new connections will be created,
but those previous connections will never be finally established.

Additionally, as the signaling messages can be received before the join
call response the participant list could be received while the call
state is "RECONNECTING" or "PUBLISHER_FAILED". In those cases, as long
as the local participant is already in the call, the participant list
should be processed as if the call state was already "JOINED" (otherwise
the connections were not established either).

For simplicity the participant list is now ignored only when the call
state is "LEAVING"; this means that the participant list would be also
processed in the "CONNECTION_TIMEOUT" state, but the signaling message
should not be received anyway in that case.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 11:00:05 +00:00
Daniel Calviño Sánchez
8cdcc63687 Return without further processing if the call is remotely ended
If the call is hung up with a view shutdown (which finishes the
activity) there is no need to do any further processing on the
participant list.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 11:00:05 +00:00
Daniel Calviño Sánchez
379ec8eae8 Fix call state when join call response is received after signaling
When a call is joined the call flags of the local participant change, so
this causes a signaling message to be sent by the server. When the HPB
is used the signaling message is sent through a WebSocket, which is
already connected before joining the call. Therefore, in some cases the
signaling message can be received through the WebSocket even before the
response to the HTTP "joinCall" request.

If there are other participants in the call the call state is changed to
"IN_CONVERSATION" when the signaling message is processed. However, in
the case described above the call state was then set to "JOINED", which
automatically traverses to "CONNECTION_TIMEOUT" if no other call state
was set in 45 seconds. Due to all this the call was joined and the
connections with the other participants were established, but they were
not visible in the UI (although they could be heard) and after 45
seconds the call was left.

To prevent that now the call state is changed to "JOINED" if it was not
already changed to "IN_CONVERSATION" in the meantime.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-12-23 11:00:05 +00:00
Andy Scherzinger
528deb1fb4
Merge pull request #2648 from nextcloud/bugfix/2647/fixNpeProcessAutocompleteUserList
avoid NPE in processAutocompleteUserList
2022-12-23 11:50:43 +01:00
Nextcloud bot
23c64b10f9
Fix(l10n): 🔠 Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-12-23 10:19:11 +00:00
Nextcloud bot
9fec1851b8
Fix(l10n): 🛠️ Update Transifex configuration
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-12-23 10:17:29 +00:00
Marcel Hibbe
d9280d3d98
avoid NPE in processAutocompleteUserList
did not test why this can happen.   autocompleteUser.id must have been null..

Exception java.lang.NullPointerException:
  at com.nextcloud.talk.controllers.ContactsController.processAutocompleteUserList (ContactsController.kt:498)
  at com.nextcloud.talk.controllers.ContactsController.processAutocompleteUserList (ContactsController.kt:482)
  at com.nextcloud.talk.controllers.ContactsController.access$processAutocompleteUserList (ContactsController.kt:90)
  at com.nextcloud.talk.controllers.ContactsController$fetchData$1.onNext (ContactsController.kt:438)
  at com.nextcloud.talk.controllers.ContactsController$fetchData$1.onNext (ContactsController.kt:432)
  at io.reactivex.internal.operators.observable.ObservableRetryPredicate$RepeatObserver.onNext (ObservableRetryPredicate.java:69)
  at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal (ObservableObserveOn.java:201)
  at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run (ObservableObserveOn.java:255)
  at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run (HandlerScheduler.java:124)
  at android.os.Handler.handleCallback (Handler.java:883)
  at android.os.Handler.dispatchMessage (Handler.java:100)
  at android.os.Looper.loop (Looper.java:237)
  at android.app.ActivityThread.main (ActivityThread.java:7948)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1075)

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2022-12-23 11:16:53 +01:00
Nextcloud bot
abb88972fd
Fix(l10n): 🔠 Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-12-22 07:12:15 +00:00
Nextcloud bot
67f2815211
Fix(l10n): 🛠️ Update Transifex configuration
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-12-22 07:11:18 +00:00
Andy Scherzinger
76b708489c
Merge pull request #2643 from nextcloud/dependabot/gradle/net.zetetic-android-database-sqlcipher-4.5.3
Bump android-database-sqlcipher from 4.5.2 to 4.5.3
2022-12-21 10:43:46 +01:00
dependabot[bot]
150c5f846f
Bump android-database-sqlcipher from 4.5.2 to 4.5.3
Bumps [android-database-sqlcipher](https://github.com/sqlcipher/android-database-sqlcipher) from 4.5.2 to 4.5.3.
- [Release notes](https://github.com/sqlcipher/android-database-sqlcipher/releases)
- [Commits](https://github.com/sqlcipher/android-database-sqlcipher/compare/v4.5.2...v4.5.3)

---
updated-dependencies:
- dependency-name: net.zetetic:android-database-sqlcipher
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-21 09:36:48 +00:00