Skip to content

Commit

Permalink
chore(chat): remove deprecated hype chat feature (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
outadoc authored Oct 5, 2024
1 parent 668193b commit 3ebb2fd
Show file tree
Hide file tree
Showing 18 changed files with 94 additions and 231 deletions.
1 change: 1 addition & 0 deletions app-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ kotlin {
}

androidMain.dependencies {
implementation(libs.firebase.crashlytics)
implementation(libs.material.core)
}
}
Expand Down
84 changes: 1 addition & 83 deletions app-android/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,88 +16,6 @@
android:label="@string/app_launcher_name"
android:supportsRtl="true"
android:theme="@style/Theme.App.Starting"
tools:targetApi="tiramisu">
tools:targetApi="tiramisu" />

<activity
android:name=".feature.shared.presentation.mobile.MainActivity"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:enableOnBackInvokedCallback="true"
android:exported="true"
android:launchMode="singleTask"
android:resizeableActivity="true"
android:windowSoftInputMode="adjustResize">

<layout
android:defaultWidth="1000dp"
android:defaultHeight="800dp"
android:minWidth="350dp"
android:minHeight="500dp" />

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="justchatting" />

</intent-filter>

<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="https" />
<data android:host="just-chatting.app" />

</intent-filter>
</activity>

<activity
android:name=".feature.chat.presentation.mobile.EmbeddedChatActivity"
android:allowEmbedded="true"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:exported="true"
android:resizeableActivity="true"
android:windowSoftInputMode="adjustResize">

<layout
android:defaultWidth="500dp"
android:defaultHeight="900dp"
android:minWidth="300dp"
android:minHeight="430dp" />

</activity>

<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">

<meta-data
android:name="androidx.emoji2.text.EmojiCompatInitializer"
tools:node="remove" />

</provider>

<provider
android:name=".feature.chat.presentation.UserProfileImageContentProvider"
android:authorities="${applicationId}.user-image-provider"
android:exported="true"
android:grantUriPermissions="true"
tools:ignore="ExportedContentProvider" />

<service
android:name=".feature.chat.presentation.ChatConnectionService"
android:foregroundServiceType="" />

</application>
</manifest>
8 changes: 0 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,10 @@ accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-
androidx-activity-compose = "androidx.activity:activity-compose:1.9.2"
androidx-appcompat = "androidx.appcompat:appcompat:1.7.0"
androidx-browser = "androidx.browser:browser:1.8.0"
androidx-constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4"
androidx-core = "androidx.core:core-ktx:1.13.1"
androidx-datastore-preferences = "androidx.datastore:datastore-preferences:1.1.1"
androidx-emoji2-core = { module = "androidx.emoji2:emoji2", version.ref = "emoji" }
androidx-fragment = "androidx.fragment:fragment-ktx:1.8.4"
androidx-glance-appwidget = { module = "androidx.glance:glance-appwidget", version.ref = "glance" }
androidx-glance-material3 = { module = "androidx.glance:glance-material3", version.ref = "glance" }
androidx-lifecycle-common = { module = "androidx.lifecycle:lifecycle-common", version.ref = "lifecycle" }
androidx-lifecycle-livedata = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "lifecycle" }
androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "lifecycle" }
androidx-lifecycle-service = { module = "androidx.lifecycle:lifecycle-service", version.ref = "lifecycle" }
androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "lifecycle" }
androidx-paging-common = { module = "app.cash.paging:paging-common", version.ref = "paging-multiplatform" }
Expand All @@ -59,7 +53,6 @@ androidx-paging-runtime-android = { module = "androidx.paging:paging-runtime", v
androidx-paging-runtime-ios = { module = "app.cash.paging:paging-runtime-uikit", version.ref = "paging-multiplatform" }
androidx-palette = "androidx.palette:palette:1.0.0"
androidx-splashscreen = "androidx.core:core-splashscreen:1.0.1"
bignum = "com.ionspin.kotlin:bignum:0.3.10"
coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" }
coil-core = { module = "io.coil-kt.coil3:coil", version.ref = "coil" }
coil-gif = { module = "io.coil-kt.coil3:coil-gif", version.ref = "coil" }
Expand All @@ -74,7 +67,6 @@ compose-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata
compose-ui-core = { module = "androidx.compose.ui:ui" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
desugar = "com.android.tools:desugar_jdk_libs:2.1.2"
fluid-currency = "io.fluidsonic.currency:fluid-currency:0.13.0"
firebase-bom = "com.google.firebase:firebase-bom:33.4.0"
firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics" }
haze-core = { module = "dev.chrisbanes.haze:haze", version.ref = "haze" }
Expand Down
2 changes: 0 additions & 2 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ kotlin {
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.paging.common)
implementation(libs.androidx.paging.compose.common)
implementation(libs.bignum)
implementation(libs.coil.compose)
implementation(libs.coil.core)
implementation(libs.coil.ktor)
Expand All @@ -73,7 +72,6 @@ kotlin {
implementation(libs.compose.material.adaptive.navigation)
implementation(libs.compose.material.adaptive.navigationSuite)
implementation(libs.compose.material.windowSizeClass)
implementation(libs.fluid.currency)
implementation(libs.haze.core)
implementation(libs.haze.materials)
implementation(libs.koin.core)
Expand Down
98 changes: 92 additions & 6 deletions shared/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

<receiver
android:name="fr.outadoc.justchatting.feature.timeline.presentation.widget.LiveWidgetReceiver"
android:label="@string/live"
android:exported="true">
android:exported="true"
android:label="@string/live">

<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
Expand All @@ -51,8 +51,8 @@

<receiver
android:name="fr.outadoc.justchatting.feature.followed.presentation.widget.FollowedChannelsWidgetReceiver"
android:label="@string/channels"
android:exported="true">
android:exported="true"
android:label="@string/channels">

<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
Expand All @@ -70,8 +70,8 @@

<receiver
android:name="fr.outadoc.justchatting.feature.recent.presentation.widget.RecentChannelsWidgetReceiver"
android:label="@string/chat_header_recent"
android:exported="true">
android:exported="true"
android:label="@string/chat_header_recent">

<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
Expand All @@ -87,5 +87,91 @@

</receiver>

<activity
android:name="fr.outadoc.justchatting.feature.shared.presentation.mobile.MainActivity"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:enableOnBackInvokedCallback="true"
android:exported="true"
android:launchMode="singleTask"
android:resizeableActivity="true"
android:windowSoftInputMode="adjustResize"
tools:targetApi="tiramisu">

<layout
android:defaultWidth="1000dp"
android:defaultHeight="800dp"
android:minWidth="350dp"
android:minHeight="500dp" />

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="justchatting" />

</intent-filter>

<intent-filter
android:autoVerify="true"
tools:targetApi="m">

<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="https" />
<data android:host="just-chatting.app" />

</intent-filter>
</activity>

<activity
android:name="fr.outadoc.justchatting.feature.chat.presentation.mobile.EmbeddedChatActivity"
android:allowEmbedded="true"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:exported="true"
android:resizeableActivity="true"
android:windowSoftInputMode="adjustResize"
tools:targetApi="n">

<layout
android:defaultWidth="500dp"
android:defaultHeight="900dp"
android:minWidth="300dp"
android:minHeight="430dp" />

</activity>

<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">

<meta-data
android:name="androidx.emoji2.text.EmojiCompatInitializer"
tools:node="remove" />

</provider>

<provider
android:name="fr.outadoc.justchatting.feature.chat.presentation.UserProfileImageContentProvider"
android:authorities="${applicationId}.user-image-provider"
android:exported="true"
android:grantUriPermissions="true"
tools:ignore="ExportedContentProvider" />

<service
android:name="fr.outadoc.justchatting.feature.chat.presentation.ChatConnectionService"
android:foregroundServiceType="" />

</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
package fr.outadoc.justchatting.utils.presentation

import com.ionspin.kotlin.bignum.decimal.BigDecimal
import io.fluidsonic.currency.Currency
import io.fluidsonic.currency.toPlatform
import java.text.NumberFormat
import java.util.Locale

internal actual fun Float.formatPercent(): String =
NumberFormat.getPercentInstance(Locale.getDefault()).format(this)

internal actual fun Int.formatNumber(): String = "%,d".format(this)

internal actual fun BigDecimal.formatCurrency(currency: Currency): String =
NumberFormat.getCurrencyInstance()
.apply { this.currency = currency.toPlatform() }
.format(this)
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ internal class TwitchIrcCommandParserTest {
timestamp = Instant.parse("2017-10-05T23:36:12.675Z"),
rewardId = null,
inReplyTo = null,
paidMessageInfo = null,
)
}
}
Expand Down Expand Up @@ -83,7 +82,6 @@ internal class TwitchIrcCommandParserTest {
timestamp = Instant.parse("2022-07-08T16:47:29.487Z"),
rewardId = null,
inReplyTo = null,
paidMessageInfo = null,
)
}
}
Expand Down Expand Up @@ -185,7 +183,6 @@ internal class TwitchIrcCommandParserTest {
timestamp = Instant.parse("2022-07-08T16:49:19.852Z"),
rewardId = null,
inReplyTo = null,
paidMessageInfo = null,
),
)
}
Expand Down Expand Up @@ -218,7 +215,6 @@ internal class TwitchIrcCommandParserTest {
timestamp = Instant.parse("2022-07-08T17:23:35.335Z"),
rewardId = null,
inReplyTo = null,
paidMessageInfo = null,
),
)
}
Expand Down Expand Up @@ -365,7 +361,6 @@ internal class TwitchIrcCommandParserTest {
userId = "108193474",
userLogin = "brankhorst",
),
paidMessageInfo = null,
)
}
}
Expand Down Expand Up @@ -399,7 +394,6 @@ internal class TwitchIrcCommandParserTest {
isFirstMessageByUser = false,
rewardId = null,
inReplyTo = null,
paidMessageInfo = null,
),
)
}
Expand Down Expand Up @@ -432,13 +426,6 @@ internal class TwitchIrcCommandParserTest {
isFirstMessageByUser = false,
rewardId = null,
inReplyTo = null,
paidMessageInfo = ChatEvent.Message.ChatMessage.PaidMessageInfo(
amount = 600,
currency = "EUR",
exponent = 2,
isSystemMessage = false,
level = "TWO",
),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,6 @@ internal fun Map<String, String?>.parseParentMessage(): ChatEvent.Message.ChatMe
)
}

internal fun Map<String, String?>.parsePaidMessageInfo(): ChatEvent.Message.ChatMessage.PaidMessageInfo? {
return ChatEvent.Message.ChatMessage.PaidMessageInfo(
amount = this["pinned-chat-paid-amount"]?.toLongOrNull()
?: this["pinned-chat-paid-canonical-amount"]?.toLongOrNull()
?: return null,
currency = this["pinned-chat-paid-currency"] ?: return null,
exponent = this["pinned-chat-paid-exponent"]?.toLongOrNull() ?: return null,
isSystemMessage = this["pinned-chat-paid-is-system-message"] == "1",
level = this["pinned-chat-paid-level"] ?: return null,
)
}

internal val Map<String, String?>.banDuration: Duration?
get() = this["ban-duration"]?.toIntOrNull()?.seconds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ internal class TwitchIrcCommandParser(private val clock: Clock) {
timestamp = ircMessage.tags.parseTimestamp() ?: clock.now(),
rewardId = ircMessage.tags.customRewardId,
inReplyTo = ircMessage.tags.parseParentMessage(),
paidMessageInfo = ircMessage.tags.parsePaidMessageInfo(),
)
}

Expand Down
Loading

0 comments on commit 3ebb2fd

Please sign in to comment.