Commit Graph

315 Commits

Author SHA1 Message Date
sowjanyakch
1ed89b2a53
delete event conversation
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-22 15:15:58 +02:00
sowjanyakch
0104989eef
show warning dialog when call ends
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-22 15:15:57 +02:00
rapterjet2004
62d9a47c37
Tables work
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
2025-05-22 14:53:54 +02:00
Marcel Hibbe
971cc79b76
open context search when message was not found or adapter was null
Opening it when adapter was null is a bit hacky but it works (better would be to make sure adapter is not null of course)

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-05-21 16:56:22 +02:00
rapterjet2004
0b40e06f46
Appended to work with replies
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
2025-05-21 14:28:58 +02:00
rapterjet2004
fd7afccbc4
Follow up improvements
- Added ComposePreviewUtils
- Added ComposePreviewUtilsDao (both for previewing w/ dependencies)
- Additional fixes

Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
2025-05-21 14:28:57 +02:00
sowjanyakch
582eda8480
merge conflicts
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-14 19:03:08 +02:00
sowjanyakch
70bfbb3210
refactor
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-14 18:58:37 +02:00
sowjanyakch
3dc390a8cd
ktlintFormat
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-14 18:58:37 +02:00
sowjanyakch
4ec2cb8e7a
make snackbar clickable
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-14 18:58:37 +02:00
sowjanyakch
40ffa582e3
fix detekt
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-14 17:37:59 +02:00
sowjanyakch
cf27a489e7
use calendar icon instead of calendar clock icon
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-14 17:37:59 +02:00
sowjanyakch
44065ae946
archive conversation
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-14 17:37:58 +02:00
sowjanyakch
b128c5a8ea
use string resources
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-14 17:37:58 +02:00
sowjanyakch
fd47146729
UI changes and hiding events
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-14 17:37:57 +02:00
sowjanyakch
83b8915787
add icon for event conversations
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-14 17:37:57 +02:00
sowjanyakch
f11ed31408
update snackbar text
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-05-14 11:13:38 +02:00
Marcel Hibbe
ab19f631ae
get Note-to-Self room by endpoint + convert to coroutines
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-04-29 13:40:27 +02:00
Marcel Hibbe
c6d1f68442
fix jumping Note to self option in message action dialog.
Only get room for Note to Self after clicking on the option..

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-04-29 12:32:36 +02:00
Sowjanya Kota
a9090d4e71
Merge pull request #4826 from nextcloud/feature/4712/addParticipantTo1to1
Feature/4712/add participant to1to1
2025-04-17 12:47:19 +02:00
sowjanyakch
a82218055e
use display name of user instead of userId
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
2025-04-16 15:19:55 +02:00
Marcel Hibbe
d0190158d5
avoid NPE in onLoadMore
For v21.0.0, the following crash was reported:

Exception java.lang.NullPointerException: null cannot be cast to non-null type com.nextcloud.talk.chat.data.model.ChatMessage
  at com.nextcloud.talk.chat.ChatActivity.onLoadMore (ChatActivity.kt:3107)
  at com.stfalcon.chatkit.messages.MessagesListAdapter.onLoadMore (MessagesListAdapter.java:148)
  at com.stfalcon.chatkit.messages.RecyclerScrollMoreListener.onScrolled (RecyclerScrollMoreListener.java:82)
  at androidx.recyclerview.widget.RecyclerView.dispatchOnScrolled (RecyclerView.java:5688)
  at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep3 (RecyclerView.java:4741)
  at androidx.recyclerview.widget.RecyclerView.dispatchLayout (RecyclerView.java:4367)
  at androidx.recyclerview.widget.RecyclerView.onLayout (RecyclerView.java:4919)

This is now improved:
- lastOrNull prevents exceptions if no matching item is found
- as? is a safe cast that returns null if the cast fails

Whole expression becomes null-safe, and id will be null if anything along the way doesn't match. Only when not null, onLoadMore continues.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-04-14 14:21:51 +02:00
Marcel Hibbe
c2ad89f7fb
minor refactoring
to be discussed: does it make sense to show a dialog instead? At least when it's created via 1:1 conversation

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-04-14 11:03:46 +02:00
Marcel Hibbe
77fe2ad024
refactor getRetrofitBucketForCreateRoom
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-04-14 11:03:45 +02:00
Marcel Hibbe
c9136cdf15
replace snackbar with toasts for breakout room infos
snackbars disaapear with the switch to a different screen. Toasts survive the switch so they are visible during the activities switch

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-04-14 11:03:43 +02:00
Marcel Hibbe
8009cc1013
Add new photo picker
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-03-27 23:59:08 +01:00
Andy Scherzinger
db944ec1bd
style(lint): Migrate to KTX extension function
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-03-19 18:07:35 +01:00
rapterjet2004
d26697b932
Abstracting away media player functionality to MediaPlayerManager
- Most code removed from ChatActivity
- Most work in MediaPlayerManager
- Added BackgroundVoiceMessageCard

Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
2025-03-04 16:02:12 -06:00
Marcel Hibbe
1bcdeb2d46
init other data earlier than ConversationModel
because setData was called too late (after sendTempChatMessages was called from messageInputFragment, internalConversationId was not initialized in repository).
With this change, internalConversationId, credentials and urlForChatting are initialized earlier which should avoid the issue.
However conversationModel is still initialized quite late and should be accessed with caution. This could may be improved by better architecture..

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-02-18 10:48:17 +01:00
Marcel Hibbe
30caa435ae
Avoid duplicated messages when activity is in background.
onDestroy is not called when navigating to the next activity or bringing the app to background. That's why the adapter was not set to null and all messages were added another time the next time the activity comes to foreground. With this fix, the adapter is set to null in onStop.

All in all, the adapter handling may not be the best, but will be replaced by Compose anyway..

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-02-17 14:59:15 +01:00
Marcel Hibbe
3330fc8210
fix shimmer and "offlineNoMessages"-info handling
when being offline and no messages are set -> hide shimmer

when messages are received -> hide shimmer and "offlineNoMessages"-info

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-23 09:45:02 +01:00
Julius Linus
1ac537be94
Merge pull request #4641 from nextcloud/bugfix/4605/fixDuplicateMessages
Bugfix/4605/fix duplicate messages
2025-01-22 11:29:15 -06:00
Marcel Hibbe
4f49deadf2
Merge pull request #4630 from nextcloud/bugfix/4628/noUnreadMessagesBubbleForInvisibleMessages
no "unread messages" popup for invisible messages
2025-01-22 16:57:08 +00:00
Marcel Hibbe
9b6b01254a
remove scope cancelation for handleChatOnBackPress (replace with lifecyle event)
handleOnStop will handle this (and more scenarios than just backpress)

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-22 13:59:03 +01:00
Marcel Hibbe
b6e341bbf1
cancel scope when onStop is reached
This is necessary especially to cancel the long polling when configuration change was made, e.g. screen was rotated. Otherwise multiple long polling requests would be running after configuration changes.

Because it not possible to launch a new coroutine in a scope that was canceled, it is necessary to re-initialize the scope.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-22 13:50:30 +01:00
Marcel Hibbe
5535bed35c
no "unread messages" popup for invisible messages
if chatMessageList is empty after handleSystemMessages it makes no sense to call the following methods.
Also processMessagesFromTheFuture was executed which caused that the popup was shown.

A better solution for the future should be to handle(remove) the "to-hide" system messages already in the repo or viewmodel

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-17 14:09:58 +01:00
Marcel Hibbe
20612c8543
avoid shimmer animations overlay with chat messages
The idea to show the progress bar (aka shimmer animation) was that it show not be shown at all if loading messages happens in less than a second (this was a better UX in my opinion).

The idea was to hide the progress bar when
ChatMessageStartState was triggered.

However there can be moment when adapter is still empty after ChatMessageStartState and if in this moment the DELAY_TO_SHOW_PROGRESS_BAR is reached before the adapter is actually filled, the overlay happens.
It could be a solution to move the hiding of the progress bar, however then special cases might have to be handled.

For simplicity, the logic for DELAY_TO_SHOW_PROGRESS_BAR is removed. Progress bar is always shown without a delay so it wont be triggered on a later moment and can't overlay the chat.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-17 13:40:57 +01:00
Marcel Hibbe
6e1114d4d8
fix TooManyRequestsException
By using
networkMonitor.isOnline.first()
the function
unregisterNetworkCallback
was triggered, which sometimes causes the ConnectivityManager$TooManyRequestsException.

So each time isOnline.first() was called, the callbackFlow would:
- Register a new NetworkCallback.
- Emit a value and cancel the flow.
- Unregister the NetworkCallback.

The exception was:
Exception android.net.ConnectivityManager$TooManyRequestsException:
  at android.net.ConnectivityManager.convertServiceException (ConnectivityManager.java:3771)
  at android.net.ConnectivityManager.sendRequestForNetwork (ConnectivityManager.java:3960)
  at android.net.ConnectivityManager.sendRequestForNetwork (ConnectivityManager.java:3967)
  at android.net.ConnectivityManager.registerNetworkCallback (ConnectivityManager.java:4349)
  at android.net.ConnectivityManager.registerNetworkCallback (ConnectivityManager.java:4319)
  at com.nextcloud.talk.data.network.NetworkMonitorImpl$isOnline$1.invokeSuspend (NetworkMonitorImpl.kt:61)

To fix this, the cold flow from callbackFlow is converted to a StateFlow.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-16 13:50:51 +01:00
rapterjet2004
19aec5460a
figured it out - was an error with offline conversations not syncing. Chat permissions were updated on server, but not on device.
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-14 16:35:55 +01:00
Marcel Hibbe
3dca00bac0
resolve warnings
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-10 12:32:31 +01:00
Marcel Hibbe
ab007fc444
resolve codacy/ktlint warnings
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-10 12:32:30 +01:00
Marcel Hibbe
8f1f22fd54
Fix duplicate "Today"-bug
If user sent a message as a first message in today's chat, the temp message will be deleted when messages are retrieved from server, but also the date has to be deleted as it will be added again when the chat messages are added from server. Otherwise date "Today" would be shown twice.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-10 12:32:30 +01:00
Marcel Hibbe
0356f5ac3c
fix to not accidentally show unread messages popup
reason was that the UI was not yet loaded but isScrolledToBottom was already called, so findFirstVisibleItemPosition returned -1.

Fix for now is to return true for isScrolledToBottom when position is -1

They does not solve the root cause for now. It should be made sure the code is not executed until UI is ready.
A quick try with
repeatOnLifecycle(Lifecycle.State.STARTED)
when collecting getMessageFlow did not help.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-10 12:32:30 +01:00
Marcel Hibbe
29362fab4b
add logging for unread messages popup bug
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-10 12:32:30 +01:00
Marcel Hibbe
b529d1328a
delete roomId comments
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-10 12:32:30 +01:00
Marcel Hibbe
f62941f6aa
simplify "sent messages are queued" hint
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-10 12:32:29 +01:00
Marcel Hibbe
656be3ffce
revert ReadStatus SENDING and FAILED
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-10 12:32:29 +01:00
Marcel Hibbe
1bfb3ba027
WIP add options to temp messages
TODO:
check id type --> see TODO "currentTimeMillies fails as id because later on in the model it's not Long but Int!!!!" in OfflineFirstChatRepository.kt

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-10 12:32:27 +01:00
Marcel Hibbe
0f53244652
prepare to replace no-internet-connection message handling (sorry Julius!!)
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-10 12:32:27 +01:00
Marcel Hibbe
3f5f2f024a
works okay (no resend logic yet, offline message mode not reworked)
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-10 12:32:27 +01:00