-
Notifications
You must be signed in to change notification settings - Fork 38
Upgrade Stream Chat Depencency to v6 #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ package io.getstream.avengerschat.initializer | |
| import android.content.Context | ||
| import android.content.Intent | ||
| import androidx.startup.Initializer | ||
| import io.getstream.android.push.firebase.FirebasePushDeviceGenerator | ||
| import io.getstream.avengerschat.BuildConfig | ||
| import io.getstream.avengerschat.R | ||
| import io.getstream.avengerschat.core.uicomponents.startup.StreamGlobalStyleInitializer | ||
|
|
@@ -28,10 +29,10 @@ import io.getstream.chat.android.client.logger.ChatLogLevel | |
| import io.getstream.chat.android.client.notifications.handler.NotificationConfig | ||
| import io.getstream.chat.android.client.notifications.handler.NotificationHandler | ||
| import io.getstream.chat.android.client.notifications.handler.NotificationHandlerFactory | ||
| import io.getstream.chat.android.offline.model.message.attachments.UploadAttachmentsNetworkType | ||
| import io.getstream.chat.android.offline.plugin.configuration.Config | ||
| import io.getstream.chat.android.models.UploadAttachmentsNetworkType | ||
| import io.getstream.chat.android.offline.plugin.factory.StreamOfflinePluginFactory | ||
| import io.getstream.chat.android.pushprovider.firebase.FirebasePushDeviceGenerator | ||
| import io.getstream.chat.android.state.plugin.config.StatePluginConfig | ||
| import io.getstream.chat.android.state.plugin.factory.StreamStatePluginFactory | ||
| import timber.log.Timber | ||
|
|
||
| /** | ||
|
|
@@ -43,14 +44,13 @@ class StreamChatInitializer : Initializer<Unit> { | |
| Timber.d("StreamChatInitializer is initialized") | ||
|
|
||
| val logLevel = if (BuildConfig.DEBUG) ChatLogLevel.ALL else ChatLogLevel.NOTHING | ||
| val offlinePluginFactory = StreamOfflinePluginFactory( | ||
| config = Config( | ||
| val offlinePluginFactory = StreamOfflinePluginFactory(appContext = context) | ||
| val statePluginFactory = StreamStatePluginFactory( | ||
| appContext = context, | ||
| config = StatePluginConfig( | ||
| backgroundSyncEnabled = true, | ||
| userPresence = true, | ||
| persistenceEnabled = true, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whenever the Offline Plugin is used, the persistence is enabled. This flag is not needed anymore |
||
| uploadAttachmentsNetworkType = UploadAttachmentsNetworkType.NOT_ROAMING | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This configuration is added to the |
||
| ), | ||
| appContext = context | ||
| userPresence = true | ||
| ) | ||
| ) | ||
|
|
||
| /** | ||
|
|
@@ -60,7 +60,8 @@ class StreamChatInitializer : Initializer<Unit> { | |
| */ | ||
| ChatClient.Builder(context.getString(R.string.stream_api_key), context) | ||
| .notifications(createNotificationConfig(), createNotificationHandler(context)) | ||
| .withPlugin(offlinePluginFactory) | ||
| .withPlugins(offlinePluginFactory, statePluginFactory) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both plugins are included |
||
| .uploadAttachmentsNetworkType(UploadAttachmentsNetworkType.NOT_ROAMING) | ||
| .logLevel(logLevel) | ||
| .build() | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ | |
| package io.getstream.avengerschat.core.data.repository.dm | ||
|
|
||
| import androidx.annotation.WorkerThread | ||
| import io.getstream.chat.android.client.models.User | ||
| import io.getstream.chat.android.models.User | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Models has been moved to a different package |
||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| interface DirectMessageRepository { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,9 +27,9 @@ import io.getstream.avengerschat.core.network.AppDispatchers | |
| import io.getstream.avengerschat.core.network.Dispatcher | ||
| import io.getstream.chat.android.client.ChatClient | ||
| import io.getstream.chat.android.client.api.models.QueryUsersRequest | ||
| import io.getstream.chat.android.client.models.Filters | ||
| import io.getstream.chat.android.client.models.User | ||
| import io.getstream.chat.android.client.utils.onSuccessSuspend | ||
| import io.getstream.chat.android.models.Filters | ||
| import io.getstream.chat.android.models.User | ||
| import kotlinx.coroutines.CoroutineDispatcher | ||
| import kotlinx.coroutines.flow.flow | ||
| import kotlinx.coroutines.flow.flowOn | ||
|
|
@@ -61,7 +61,7 @@ internal class DirectMessageRepositoryImpl @Inject constructor( | |
| ) | ||
| val result = chatClient.queryUsers(usersRequest).await() | ||
| result.onSuccessSuspend { | ||
| emit(result.data()) | ||
| emit(it) | ||
|
Comment on lines
63
to
+64
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| }.flowOn(dispatcher) | ||
|
|
||
|
|
@@ -77,7 +77,7 @@ internal class DirectMessageRepositoryImpl @Inject constructor( | |
| extraData = mapOf() | ||
| ).await() | ||
| result.onSuccessSuspend { | ||
| emit(result.data().cid) | ||
| emit(it.cid) | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ | |
| android:layout_width="match_parent" | ||
| android:layout_height="match_parent"> | ||
|
|
||
| <io.getstream.chat.android.ui.channel.list.header.ChannelListHeaderView | ||
| <io.getstream.chat.android.ui.feature.channels.header.ChannelListHeaderView | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some Views have been moved to other package names to keep the parity with the |
||
| android:id="@+id/channelListHeaderView" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
|
|
@@ -41,7 +41,7 @@ | |
| tools:background="@color/colorPrimary" | ||
| tools:layout_height="56dp" /> | ||
|
|
||
| <io.getstream.chat.android.ui.channel.list.ChannelListView | ||
| <io.getstream.chat.android.ui.feature.channels.list.ChannelListView | ||
| android:id="@+id/channelListView" | ||
| android:layout_width="0dp" | ||
| android:layout_height="0dp" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Push Classes" are into a new artifact with different package name